On 02/24/2011 07:56 AM, Michal Privoznik wrote: > --- > src/conf/domain_conf.c | 2 ++ > src/conf/domain_conf.h | 1 + > 2 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c > index b97c1f0..454f631 100644 > --- a/src/conf/domain_conf.c > +++ b/src/conf/domain_conf.c > @@ -2593,8 +2593,10 @@ virDomainNetDefParseXML(virCapsPtr caps, > (const char *)macaddr); > goto error; > } > + def->mac_generated = false; > } else { > virCapabilitiesGenerateMac(caps, def->mac); > + def->mac_generated = true; > } Rather than sticking the flag into the domain definition, I'd rather pass it via the flags argument to virDomainDeviceDefParse/virDomainNetDefParseXML - that is, most callers will want: virDomainDeviceDefParse(..., 0) but qemuDomainDetachDevice (in qemu_driver.c) will want: virDomainDeviceDefParse(..., VIR_DOMAIN_PARSE_NO_GENERATE) (or maybe VIR_DOMAIN_XML_INACTIVE vs. VIR_DOMAIN_XML_INACTIVE|VIR_DOMAIN_PARSE_NO_GENERATE) That is, it's more than just detaching an interface mac addresses that has an issue. It's anywhere that parsing a device XML snippet to be used to match an existing device that we want to suppress generation of additional items in the parse (this includes generating a random mac for an interface, but may include other generated items). So adding a new flag that can be used to tell ALL parse routines to avoid generating extra data is more useful than changing the domain definition to say whether one piece of information was generated. -- Eric Blake eblake@xxxxxxxxxx +1-801-349-2682 Libvirt virtualization library http://libvirt.org
Attachment:
signature.asc
Description: OpenPGP digital signature
-- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list