On Wed, Jun 17, 2009 at 12:22:13PM -0700, David Lutterkort wrote:
> On Wed, 2009-06-17 at 19:24 +0100, Daniel P. Berrange wrote:
> > IP address information should be in the XML, and indeed surely it is 
> > already there in order to allow non-DHCP  based IP address config
> > on interfaces ?
> 
> Yes, for statically configured interfaces, the IP information is in the
> XML - that is the _configured_ IP info though, not necessarily the one
> that the interface actually uses. The two can diverge, for example, if
> an interface is already up and then reconfigured.

We should be using a flag for virInterfaceDumpXML to deal with this
problem, eg   virInterfaceDumpXML(iface, 0)  would give the config
appropriate to the device's current state. To explicitly get the
inactive config for a interface that is active, you would then do
virInterfaceDumpXML(iface, VIR_INTERFACE_INACTIVE).  This matches
what we do for guest domain XML, eg to cope with VNC port number
auto-allocation, or PTY device naming auto-allocation

So, even if the XML indicates type=dhcp, then for an active interface
you'd still expect to get back multiple IP address elements for each
configured address

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 :|

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to