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

Daniel P. Berrange berrange at redhat.com
Mon Oct 5 11:02:37 UTC 2009


On Tue, Sep 29, 2009 at 04:02:30PM -0400, Laine Stump wrote:
> From: root <root at vlap.laine.org>
> 
> This patch adds the flag VIR_INTERFACE_XML_INACTIVE to
> virInterfaceGetXMLDesc's flags. When it is *not* set (the default),
> the live interface info will be returned in the XML. in particular,
> the IP address(es) and netmask(s) will be retrieved by querying the
> device directly, rather than just reporting what's in the config
> file. The backend of this is in netcf's new ncf_if_xml_state()
> function.
> 
> Any live interface ip address info in the xml will have the property
> "source" set to "device", eg:
> 
>          <ip address='10.24.0.1' prefix='24' source='device'/>

This new 'source' attribute is bogus. The fact that the XML is the
showing the device details, and not the config file details is
inherent in the fact that we're querying the live interface. This
distinction applies to the entire XML dump, not just the <ip> tag.

> Also, if an interface is currently inactive, no ip addresses will be
> returned, since an inactive interface device can't be queried for IP
> addresses (effectively it has none).
> 
> A difference in the XML from previously - it is now acceptable to have
> both a dhcp *and* an ip node (or neither) within the protocol
> node. Before you had to have one or the other, but couldn't have both.
> 
> Note that you need at least netcf 0.1.2 for this to build and work,
> and an upcoming release (patches submitted today) for it to work
> exactly as described above.

With the exception of the new 'source' attribute on <ip>, the
rest of this pach looks good.

Regards,
Daniel
-- 
|: 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 :|




More information about the libvir-list mailing list