[Libvirt-cim] [PATCH 1 of 2] RPCC: returns instances of Xen on a KVM only system

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Fri Feb 1 16:25:29 UTC 2008


Heidi Eckhart wrote:
> # HG changeset patch
> # User Heidi Eckhart <heidieck at linux.vnet.ibm.com>
> # Date 1201865505 -3600
> # Node ID d4b86a39d55d2208c5f56a6666ccc212ab60a240
> # Parent  6b1bf8231d82f51f25ac3d954b63962bfc7484c9
> RPCC: returns instances of Xen on a KVM only system
> 
> This breaks the approach that is used all over libvirt-cim
> providers, where only instances of the currently supported
> hypervisor type are returned.
> 
> Signed-off-by: Heidi Eckhart <heidieck at linux.vnet.ibm.com>
> 
> diff -r 6b1bf8231d82 -r d4b86a39d55d src/Virt_ResourcePoolConfigurationCapabilities.c
> --- a/src/Virt_ResourcePoolConfigurationCapabilities.c	Fri Feb 01 12:20:46 2008 +0100
> +++ b/src/Virt_ResourcePoolConfigurationCapabilities.c	Fri Feb 01 12:31:45 2008 +0100
> @@ -51,28 +51,39 @@ static CMPIStatus get_rpc_cap(const CMPI
>                                const CMPIObjectPath *reference,
>                                CMPIInstance **_inst)
>  {
> -        CMPIInstance *inst;
> +        CMPIStatus s = {CMPI_RC_OK, NULL};
> +        CMPIInstance *inst = NULL;
> +        virConnectPtr conn = NULL;
> +
> +        conn = connect_by_classname(_BROKER, CLASSNAME(reference), &s);
> +        if (conn == NULL)
> +                goto out;

Not sure if everyone will agree, but would it be a good idea to set an 
error status here?

Currently, only Virt_ResourcePoolConfigurationCapabilities is calling 
this function, but I think that's a potential bug.  ElementCapabilities 
doesn't support this Capabilities class, but I think it should based on 
the ResourceAllocation profile.

Of course, that's a subject of a different patch.  However, if we set 
the status here, then ElementCapabilities won't have to worry about 
checking whether the instance is NULL.
-- 
Kaitlin Rupert
IBM Linux Technology Center
kaitlin at linux.vnet.ibm.com




More information about the Libvirt-cim mailing list