[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] Support reporting live interface IP/netmask.

On Mon, Oct 05, 2009 at 02:34:05PM -0700, David Lutterkort wrote:
> On Mon, 2009-10-05 at 17:34 +0100, Daniel P. Berrange wrote:
> > With the domain XML format, we did have a few abortive attempts at
> > indicating in the live XML, whether an attribute was from the 
> > persistent config, vs dynamically added to live config, but it all
> > ended up as rather a mess.
> Here's a concrete example where this leads to headscratching, at a
> minimum, with the netowrk configs. When the live XML contains
>         <protocol family="ipv4">
>           <dhcp/>
>           <ip address="" prefix="24"/>
>           <route gateway=""/>
>         </protocol>
> you at least think that the interface is configured to use DHCP, and
> currently has the indicated address. Of course, if we ever poke around
> to see if the interface _currently_ gets its address from DHCP, we have
> no way to indicate that anymore, since we would indicate 'configured to
> use DHCP' and 'currently gets its address from DHCP' in exactly the same
> way. Also, US $5 to anybody who knows whether the <route/> tag above
> says 'is configured to use that gateway' or 'routing is through that
> gateway right now'.

The live XML should *always* say what the inteface is doing right

> To belabor this point, when the live XML says
>         <protocol family="ipv4">
>           <ip address="" prefix="24"/>
>           <ip address="" prefix="24"/>
>         </protocol>
> it's completely unclear what addresses are in the config files (maybe
> both?) and which ones are actually assigned to the interface right now.

I think there is a disconnect here about the behaviour we should
be exposing.  In that example of live XML above with 2 IP addresses,
both of those IP address *must* be currently assigned to the interface,
since this is the live XML.  To determine which (if any) of those
addresses are in the config file, the VIR_INTEFACE_XML_INACTIVE flag
would be used.

Looking at netcf, it does not appear to implement this correctly. If
I query the live XML of an interface, it gives back a mixture of
both the config file and active addresses. Indeed, if using a static
IP address, it'll list the same IP address twice in the XML once it
pulls it from the config file, and once from the interface. 

|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]