Re: [PATCH 16/20] uml: reject unknown flags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 06, 2011 at 05:23:59PM -0600, Eric Blake wrote:
> * src/uml/uml_driver.c (umlOpen, umlDomainGetXMLDesc)
> (umlDomainBlockPeek): Reject unknown flags.
> ---
>  src/uml/uml_driver.c |   14 +++++++++++---
>  1 files changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
> index 6a396e4..22af8fb 100644
> --- a/src/uml/uml_driver.c
> +++ b/src/uml/uml_driver.c
> @@ -946,7 +946,10 @@ static void umlShutdownVMDaemon(virConnectPtr conn ATTRIBUTE_UNUSED,
> 
>  static virDrvOpenStatus umlOpen(virConnectPtr conn,
>                                  virConnectAuthPtr auth ATTRIBUTE_UNUSED,
> -                                unsigned int flags ATTRIBUTE_UNUSED) {
> +                                unsigned int flags)
> +{
> +    virCheckFlags(0, VIR_DRV_OPEN_ERROR);
> +
>      if (conn->uri == NULL) {
>          if (uml_driver == NULL)
>              return VIR_DRV_OPEN_DECLINED;
> @@ -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);
> @@ -2045,12 +2051,14 @@ umlDomainBlockPeek(virDomainPtr dom,
>                     const char *path,
>                     unsigned long long offset, size_t size,
>                     void *buffer,
> -                   unsigned int flags ATTRIBUTE_UNUSED)
> +                   unsigned int flags)
>  {
>      struct uml_driver *driver = dom->conn->privateData;
>      virDomainObjPtr vm;
>      int fd = -1, ret = -1, i;
> 
> +    virCheckFlags(0, -1);
> +
>      umlDriverLock(driver);
>      vm = virDomainFindByUUID(&driver->domains, dom->uuid);
>      umlDriverUnlock(driver);

ACK

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

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


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]