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

Re: [libvirt] [PATCH 04/11] caps: Switch AddGuest to take VIR_DOMAIN_OSTYPE value



On 18.04.2015 03:45, Cole Robinson wrote:
> Rather than an opencoded string. This should be a no-op
> ---
>  src/bhyve/bhyve_capabilities.c   |  2 +-
>  src/conf/capabilities.c          | 11 ++---------
>  src/conf/capabilities.h          |  2 +-
>  src/esx/esx_driver.c             |  4 ++--
>  src/libxl/libxl_conf.c           |  2 +-
>  src/lxc/lxc_conf.c               |  4 ++--
>  src/openvz/openvz_conf.c         |  2 +-
>  src/parallels/parallels_driver.c |  6 +++---
>  src/phyp/phyp_driver.c           |  2 +-
>  src/qemu/qemu_capabilities.c     |  2 +-
>  src/security/virt-aa-helper.c    |  9 +++++++--
>  src/test/test_driver.c           |  3 ++-
>  src/uml/uml_conf.c               |  2 +-
>  src/vbox/vbox_common.c           |  2 +-
>  src/vmware/vmware_conf.c         |  4 ++--
>  src/xen/xen_hypervisor.c         |  2 +-
>  src/xenapi/xenapi_driver.c       |  4 ++--
>  tests/testutils.c                |  4 ++--
>  tests/testutilslxc.c             |  6 ++++--
>  tests/testutilsqemu.c            | 18 +++++++++---------
>  tests/testutilsxen.c             | 10 ++++++----
>  tests/vmx2xmltest.c              |  4 ++--
>  tests/xml2vmxtest.c              |  4 ++--
>  23 files changed, 56 insertions(+), 53 deletions(-)
> 

> diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
> index 5a070d7..5a742a5 100644
> --- a/src/security/virt-aa-helper.c
> +++ b/src/security/virt-aa-helper.c
> @@ -707,7 +707,7 @@ caps_mockup(vahControl * ctl, const char *xmlStr)
>  static int
>  get_definition(vahControl * ctl, const char *xmlStr)
>  {
> -    int rc = -1;
> +    int rc = -1, ostype;
>      virCapsGuestPtr guest;  /* this is freed when caps is freed */
>  
>      /*
> @@ -727,8 +727,13 @@ get_definition(vahControl * ctl, const char *xmlStr)
>          goto exit;
>      }
>  
> +    if ((ostype = virDomainOSTypeFromString(ctl->hvm)) < 0) {
> +        vah_error(ctl, _("unknown OS type"));

This won't compile. You need to:

-        vah_error(ctl, _("unknown OS type"));
+        vah_error(ctl, 0, _("unknown OS type"));


> +        goto exit;
> +    }
> +
>      if ((guest = virCapabilitiesAddGuest(ctl->caps,
> -                                         ctl->hvm,
> +                                         ostype,
>                                           ctl->arch,
>                                           NULL,
>                                           NULL,

Michal


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