[Libvirt-cim] [PATCH 2 of 3] Make alloc_cap_instances() available for external use by EC

Jay Gagnon grendel at linux.vnet.ibm.com
Fri Jan 11 16:39:32 UTC 2008


Heidi Eckhart wrote:
> # HG changeset patch
> # User Heidi Eckhart <heidieck at linux.vnet.ibm.com>
> # Date 1200052159 -3600
> # Node ID 224b84cf00ac2e120d86e15d92ce50fddf6a0105
> # Parent  ec66d30629f4584ca30751ce3e079f5561f2985a
> Make alloc_cap_instances() available for external use by EC
>
> The association provider ElementCapabilities needs the
> enum_alloc_cap_instances() function to access to the list
> of available AllocationCapabilities. These are returned
> by the additional inst_list parameter.
>
> Signed-off-by: Heidi Eckhart <heidieck at linux.vnet.ibm.com>
>
> diff -r ec66d30629f4 -r 224b84cf00ac src/Virt_AllocationCapabilities.c
> --- a/src/Virt_AllocationCapabilities.c	Fri Jan 11 12:49:18 2008 +0100
> +++ b/src/Virt_AllocationCapabilities.c	Fri Jan 11 12:49:19 2008 +0100
> @@ -31,6 +31,7 @@
>
>  #include "misc_util.h"
>
> +#include "Virt_AllocationCapabilities.h"
>  #include "Virt_DevicePool.h"
>
>  const static CMPIBroker *_BROKER;
> @@ -71,30 +72,26 @@ static CMPIStatus ac_from_pool(const CMP
>          return s;
>  }
>
> -static CMPIStatus alloc_cap_instances(const CMPIBroker *broker,
> -                                      const CMPIObjectPath *ref,
> -                                      const CMPIResult *results,
> -                                      bool names_only,
> -                                      const char **properties,
> -                                      const char *id)
> -{
> +CMPIStatus enum_alloc_cap_instances(const CMPIBroker *broker,
> +                                    const CMPIObjectPath *ref,
> +                                    const char **properties,
> +                                    const char *id,
> +                                    struct inst_list *list)
> +{
> +        CMPIStatus s = {CMPI_RC_OK, NULL};
> +        CMPIInstance *alloc_cap_inst;
> +        virConnectPtr conn = NULL;
> +        struct inst_list device_pool_list;
> +        const char *inst_id;
>          int i;
> -        virConnectPtr conn = NULL;
> -        CMPIInstance *alloc_cap_inst;
> -        struct inst_list alloc_cap_list;
> -        struct inst_list device_pool_list;
> -        CMPIStatus s = {CMPI_RC_OK, NULL};
> -        const char *inst_id;
> -
> -        CU_DEBUG("In alloc_cap_instances()");
> -
> +
> +        inst_list_init(list);
>          inst_list_init(&device_pool_list);
> -        inst_list_init(&alloc_cap_list);
>   
Time for me to put on the PCO hat here. You've got some serious
declaration reordering here, and it's really muddying up the change. I
think you've got about three lines changed, but it's producing over 20
lines of diff. That can definitely be cleaned up.


-- 

-Jay




More information about the Libvirt-cim mailing list