[libvirt] [PATCH 07/10] network: new XML to support virtual switch functionality

Daniel P. Berrange berrange at redhat.com
Thu Jul 14 09:42:49 UTC 2011

On Wed, Jul 13, 2011 at 03:40:45PM -0600, Eric Blake wrote:
> On 07/05/2011 01:45 AM, Laine Stump wrote:
> > The virDomainActualNetDef will only be parsed/formatted if the
> > parse/format function is called with the VIR_DOMAIN_XML_ACTUAL_NET
> > flags set (which is only needed when saving/loading a running domain's
> > state info to the stateDir). To prevent this flag bit from
> > accidentally being used in the public API, a "RESERVED" placeholder
> > was put into the public flags enum (at the same time, I noticed there
> > was another private flag that hadn't been reserved, so I added that
> > one, making both of these flags #defined from the public RESERVED
> > flags, and since it was also only used in domain_conf.c, I unpolluted
> > domain_conf.h, putting both #defines in domain_conf.c.
> It turns out that we've used internal-use flags before.  See how
> libvirt.c filters out flags in both virDomainGetXMLDesc and
> virSecretGetValue if the flags are larger than 0xffff, so that it can
> start internal flags at 1<<16.  Regarding the networking code and our
> discussions on whether we should split out a second internalFlags
> argument rather than cramming internal and external flags into a single
> parameter, I think we should be consistent.

The difference is that this was an internal impl detail not exposed
in the public headers, so could be removed at any time.

> Meanwhile, I've got a patch to libvirt.c; I think virDomainGetXMLDesc
> should reject an attempt to pass 1<<16, rather than silently ignore it.

No, that would not be a good idea, because libvirt.c is in the code
path for the remote client, as well as the server side. We don't
want todo any flag filtering on the remote client side at all, since
we can't expect the client & server to be on the same versions. Flag
filtering can only be done after dispatch via the internal driver
table, eg in QEMU, LXC, etc directly.

|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

More information about the libvir-list mailing list