[libvirt] [PATCHv2 15/27] uml: reject unknown flags
Eric Blake
eblake at redhat.com
Thu Jul 14 13:34:03 UTC 2011
On 07/14/2011 01:21 AM, Matthias Bolte wrote:
>> +++ w/src/uml/uml_driver.c
>> @@ -1599,7 +1599,9 @@ static char *umlDomainGetXMLDesc(virDomainPtr dom,
>> virDomainObjPtr vm;
>> char *ret = NULL;
>>
>> - virCheckFlags(0, NULL);
>> + virCheckFlags(VIR_DOMAIN_XML_SECURE |
>> + VIR_DOMAIN_XML_INACTIVE |
>> + VIR_DOMAIN_XML_UPDATE_CPU, NULL);
>>
>> umlDriverLock(driver);
>> vm = virDomainFindByUUID(&driver->domains, dom->uuid);
>
> I'm not sure if it's a good idea to add the flags check for this set
> of flags at the driver level. Maybe it should be moved one level down
> into virDomainDefFormat. This avoids touching all drivers should we
> ever add a new VIR_DOMAIN_XML_* flag.
Interesting thought. I guess that means a bit more work on my side (I'd
already made the change to make all the drivers duplicate the check, but
I like the idea of having all drivers defer the check down to the common
helper).
--
Eric Blake eblake at redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110714/901a3d08/attachment-0001.sig>
More information about the libvir-list
mailing list