On Mon, 2009-10-05 at 12:02 +0100, Daniel P. Berrange wrote: > On Tue, Sep 29, 2009 at 04:02:30PM -0400, Laine Stump wrote: > > From: root <root@xxxxxxxxxxxxxx> > > > > 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. That's what I meant when I said 'I am not sure how this will be used in practice'. The options for this API call are (1) report configured and live setup side-by-side in the same XML, and mark the live setup somehow (e.g., with the source='device' attribute) (2) _only_ report live setup from this call, if you want configured setup use the VIR_INTERFACE_XML_INACTIVE flag. The advantage of (2) is that you can reuse any parsing/processsing code you might already have for the configured setup variant; the disadvantage is that you may have to handle the other variant's XML doc, too, and correlate the two. David -- Libvir-list mailing list Libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list