[libvirt] [PATCHv2 15/27] uml: reject unknown flags

Matthias Bolte matthias.bolte at googlemail.com
Wed Jul 13 12:41:55 UTC 2011


2011/7/8 Eric Blake <eblake at redhat.com>:
> * src/uml/uml_driver.c (umlOpen, umlDomainGetXMLDesc)
> (umlDomainBlockPeek): Reject unknown flags.
> ---
>  src/uml/uml_driver.c |   14 +++++++++++---
>  1 files changed, 11 insertions(+), 3 deletions(-)
>

> @@ -1559,11 +1562,14 @@ cleanup:
>
>
>  static char *umlDomainGetXMLDesc(virDomainPtr dom,
> -                                 unsigned int flags ATTRIBUTE_UNUSED) {
> +                                 unsigned int flags)
> +{
>     struct uml_driver *driver = dom->conn->privateData;
>     virDomainObjPtr vm;
>     char *ret = NULL;
>
> +    virCheckFlags(0, NULL);
> +
>     umlDriverLock(driver);
>     vm = virDomainFindByUUID(&driver->domains, dom->uuid);
>     umlDriverUnlock(driver);

Don't get fooled by the ATTRIBUTE_UNUSED again. All *DomainGetXMLDesc
use virDomainDefFormat and have to accept all flags that
virDomainDefFormat accepts. I suggest to recheck your series for this
pattern, here it's just the first time that I notice it.

ACK, with that virCheckFlags loosened correctly.

-- 
Matthias Bolte
http://photron.blogspot.com




More information about the libvir-list mailing list