[Libvirt-cim] [PATCH 1 of 2] AllocationCapabilities provider returns error code in case of non-error

Jay Gagnon grendel at linux.vnet.ibm.com
Thu Jan 24 13:53:16 UTC 2008


Heidi Eckhart wrote:
> # HG changeset patch
> # User Heidi Eckhart <heidieck at linux.vnet.ibm.com>
> # Date 1201175803 -3600
> # Node ID 65e42d8fd81f65e561b32c99189e9940e0556d00
> # Parent  43e7713d011fa74f96da379896ca9d1f2cb16205
> AllocationCapabilities provider returns error code in case of non-error
>
> wbemein http://localhost/root/virt:CIM_AllocationCapabilities
> returns
> CIM_ERR_FAILED: Could not connect to hypervisor
> in case of a KVM system with no Xen. The error message
> results from the call to the Xen_AllocationCapabilties
> part, which should only be tested but returning OK.
> Otherwise the provider breaks the CIM model.
>
> Signed-off-by: Heidi Eckhart <heidieck at linux.vnet.ibm.com>
>
> diff -r 43e7713d011f -r 65e42d8fd81f src/Virt_AllocationCapabilities.c
> --- a/src/Virt_AllocationCapabilities.c	Thu Jan 24 10:35:05 2008 +0100
> +++ b/src/Virt_AllocationCapabilities.c	Thu Jan 24 12:56:43 2008 +0100
> @@ -91,12 +91,8 @@ CMPIStatus enum_alloc_cap_instances(cons
>                  goto out;
>
>          conn = connect_by_classname(broker, CLASSNAME(ref), &s);
> -        if (conn == NULL) {
> -                cu_statusf(broker, &s,
> -                           CMPI_RC_ERR_FAILED,
> -                           "Could not connect to hypervisor");
> -                goto out;
> -        }
> +        if (conn == NULL)
> +                goto out;
>
>          s = get_all_pools(broker, conn, NAMESPACE(ref), &device_pool_list);
>          if (s.rc != CMPI_RC_OK) {
>
> _______________________________________________
> Libvirt-cim mailing list
> Libvirt-cim at redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-cim
>   
It's a good thing we don't have a place to record "number of times Jay
has broken the CIM model."  As usual, thanks for catching my mistake
here. :) +1

-- 

-Jay




More information about the Libvirt-cim mailing list