[Libvirt-cim] [PATCH 2 of 2] Add ability to get a default pool of a given type to the pool provider
Kaitlin Rupert
kaitlin at linux.vnet.ibm.com
Mon Apr 14 17:53:36 UTC 2008
Dan Smith wrote:
> # HG changeset patch
> # User Dan Smith <danms at us.ibm.com>
> # Date 1208191444 25200
> # Node ID 327cfc9f69191f5a2f0454290c8ecf02e223d4dd
> # Parent 2afa2a7d1d5a4e7d026f2f6cf8b5a1a8a266b5a0
> Add ability to get a default pool of a given type to the pool provider
>
> Signed-off-by: Dan Smith <danms at us.ibm.com>
>
> diff -r 2afa2a7d1d5a -r 327cfc9f6919 src/Virt_DevicePool.c
> --- a/src/Virt_DevicePool.c Mon Apr 14 09:44:03 2008 -0700
> +++ b/src/Virt_DevicePool.c Mon Apr 14 09:44:04 2008 -0700
> @@ -991,6 +991,39 @@ CMPIStatus enum_pools(const CMPIBroker *
> return _get_pools(broker, reference, type, NULL, list);
> }
>
> +CMPIInstance *default_device_pool(const CMPIBroker *broker,
> + const CMPIObjectPath *reference,
> + uint16_t type,
> + CMPIStatus *s)
> +{
> + CMPIInstance *inst = NULL;
> + struct inst_list list;
> +
> + inst_list_init(&list);
> +
> + if (type == CIM_RES_TYPE_MEM) {
> + *s = get_pool_by_name(broker, reference, "MemoryPool/0", &inst);
> + } else if (type == CIM_RES_TYPE_PROC) {
> + *s = get_pool_by_name(broker, reference, "ProcPool/0", &inst);
This should be ProcessorPool, which is how the InstanceID is set
elsewhere.
--
Kaitlin Rupert
IBM Linux Technology Center
kaitlin at linux.vnet.ibm.com
More information about the Libvirt-cim
mailing list