[PATCH 0 of 2] Parent pool <--> child pool support for EAFP

# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1240877148 25200 # Node ID e132a8e94381d218d39eb2fffc94b27a438abb32 # Parent 570c3507c7b2c3e55680e9a70f4889accb9a1cf7 Add parent_device_pool() which returns the parent pool for a given device type Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com> diff -r 570c3507c7b2 -r e132a8e94381 src/Virt_DevicePool.c --- a/src/Virt_DevicePool.c Tue May 05 18:08:58 2009 -0700 +++ b/src/Virt_DevicePool.c Mon Apr 27 17:05:48 2009 -0700 @@ -77,7 +77,7 @@ goto out; } - pools[count].tag = strdup("Parent"); + pools[count].tag = strdup("0"); pools[count].path = NULL; pools[count].primordial = true; count++; @@ -1234,6 +1234,45 @@ return _get_pools(broker, reference, type, NULL, list); } +CMPIInstance *parent_device_pool(const CMPIBroker *broker, + const CMPIObjectPath *reference, + uint16_t type, + CMPIStatus *s) +{ + CMPIInstance *inst = NULL; + const char *id = NULL; + + if (type == CIM_RES_TYPE_MEM) { + id = "MemoryPool/0"; + } else if (type == CIM_RES_TYPE_PROC) { + id = "ProcessorPool/0"; + } else if (type == CIM_RES_TYPE_DISK) { + id = "DiskPool/0"; + } else if (type == CIM_RES_TYPE_NET) { + id = "NetworkPool/0"; + } else if (type == CIM_RES_TYPE_GRAPHICS) { + id = "GraphicsPool/0"; + } else if (type == CIM_RES_TYPE_INPUT) { + id = "InputPool/0"; + } else { + cu_statusf(broker, s, + CMPI_RC_ERR_INVALID_PARAMETER, + "No such device type `%s'", type); + goto out; + } + + *s = get_pool_by_name(broker, reference, id, &inst); + if (inst == NULL) { + cu_statusf(broker, s, + CMPI_RC_ERR_FAILED, + "No default pool found for type %hi", type); + } + + out: + + return inst; +} + CMPIInstance *default_device_pool(const CMPIBroker *broker, const CMPIObjectPath *reference, uint16_t type, @@ -1241,43 +1280,38 @@ { CMPIInstance *inst = NULL; struct inst_list list; + bool val; - inst_list_init(&list); + if ((type == CIM_RES_TYPE_DISK) || (type == CIM_RES_TYPE_NET)) { + int i = 0; + CMPIrc rc; - 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, "ProcessorPool/0", &inst); - } else if (type == CIM_RES_TYPE_DISK) { + inst_list_init(&list); + *s = enum_pools(broker, reference, type, &list); - if ((s->rc == CMPI_RC_OK) && (list.cur > 0)) - inst = list.list[0]; - } else if (type == CIM_RES_TYPE_NET) { - *s = enum_pools(broker, reference, type, &list); - if ((s->rc == CMPI_RC_OK) && (list.cur > 0)) - inst = list.list[0]; - } else if (type == CIM_RES_TYPE_GRAPHICS) { - *s = get_pool_by_name(broker, - reference, - "GraphicsPool/0", - &inst); - } else if (type == CIM_RES_TYPE_INPUT) { - *s = get_pool_by_name(broker, - reference, - "InputPool/0", - &inst); + if ((s->rc == CMPI_RC_OK) && (list.cur > 0)) { + + for (i = 0; i < list.cur; i++) { + rc = cu_get_bool_prop(list.list[i], + "Primordial", + &val); + if ((rc != CMPI_RC_OK) || (val)) + continue; + + inst = list.list[i]; + break; + } + } + + inst_list_free(&list); + + if (inst == NULL) { + cu_statusf(broker, s, + CMPI_RC_ERR_FAILED, + "No default pool found for type %hi", type); + } } else { - cu_statusf(broker, s, - CMPI_RC_ERR_INVALID_PARAMETER, - "No such device type `%s'", type); - } - - inst_list_free(&list); - - if (inst == NULL) { - cu_statusf(broker, s, - CMPI_RC_ERR_FAILED, - "No default pool found for type %hi", type); + inst = parent_device_pool(broker, reference, type, s); } return inst; diff -r 570c3507c7b2 -r e132a8e94381 src/Virt_DevicePool.h --- a/src/Virt_DevicePool.h Tue May 05 18:08:58 2009 -0700 +++ b/src/Virt_DevicePool.h Mon Apr 27 17:05:48 2009 -0700 @@ -106,6 +106,20 @@ CMPIInstance **_inst); /** + * Get the parent pool for a given device type + * + * @param broker A pointer to the current broker + * @param ref The object path containing namespace and prefix info + * @param type The device type in question + * @param status The returned status + * @returns Parent pool instance + */ +CMPIInstance *parent_device_pool(const CMPIBroker *broker, + const CMPIObjectPath *reference, + uint16_t type, + CMPIStatus *s); + +/** * Get the default pool for a given device type * * @param broker A pointer to the current broker

Kaitlin Rupert wrote:
# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1240877148 25200 # Node ID e132a8e94381d218d39eb2fffc94b27a438abb32 # Parent 570c3507c7b2c3e55680e9a70f4889accb9a1cf7 Add parent_device_pool() which returns the parent pool for a given device type
Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com>
diff -r 570c3507c7b2 -r e132a8e94381 src/Virt_DevicePool.c --- a/src/Virt_DevicePool.c Tue May 05 18:08:58 2009 -0700 +++ b/src/Virt_DevicePool.c Mon Apr 27 17:05:48 2009 -0700 @@ -77,7 +77,7 @@ goto out; }
- pools[count].tag = strdup("Parent"); + pools[count].tag = strdup("0"); pools[count].path = NULL; pools[count].primordial = true; count++; @@ -1234,6 +1234,45 @@ return _get_pools(broker, reference, type, NULL, list); }
+CMPIInstance *parent_device_pool(const CMPIBroker *broker, + const CMPIObjectPath *reference, + uint16_t type, + CMPIStatus *s) +{ + CMPIInstance *inst = NULL; + const char *id = NULL; + + if (type == CIM_RES_TYPE_MEM) { + id = "MemoryPool/0"; + } else if (type == CIM_RES_TYPE_PROC) { + id = "ProcessorPool/0"; + } else if (type == CIM_RES_TYPE_DISK) { + id = "DiskPool/0"; + } else if (type == CIM_RES_TYPE_NET) { + id = "NetworkPool/0"; + } else if (type == CIM_RES_TYPE_GRAPHICS) { + id = "GraphicsPool/0"; + } else if (type == CIM_RES_TYPE_INPUT) { + id = "InputPool/0"; + } else { + cu_statusf(broker, s, + CMPI_RC_ERR_INVALID_PARAMETER, + "No such device type `%s'", type); + goto out; + } + + *s = get_pool_by_name(broker, reference, id, &inst); + if (inst == NULL) { + cu_statusf(broker, s, + CMPI_RC_ERR_FAILED, + "No default pool found for type %hi", type); + } + + out: + + return inst; +} + CMPIInstance *default_device_pool(const CMPIBroker *broker, const CMPIObjectPath *reference, uint16_t type, @@ -1241,43 +1280,38 @@ { CMPIInstance *inst = NULL; struct inst_list list; + bool val;
- inst_list_init(&list); + if ((type == CIM_RES_TYPE_DISK) || (type == CIM_RES_TYPE_NET)) { + int i = 0; + CMPIrc rc;
- 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, "ProcessorPool/0", &inst); - } else if (type == CIM_RES_TYPE_DISK) { + inst_list_init(&list); + *s = enum_pools(broker, reference, type, &list); - if ((s->rc == CMPI_RC_OK) && (list.cur > 0))
You probably should insert a CU_DEBUG here just to help debug
- inst = list.list[0]; - } else if (type == CIM_RES_TYPE_NET) { - *s = enum_pools(broker, reference, type, &list); - if ((s->rc == CMPI_RC_OK) && (list.cur > 0)) - inst = list.list[0]; Same here - } else if (type == CIM_RES_TYPE_GRAPHICS) { - *s = get_pool_by_name(broker, - reference, - "GraphicsPool/0", - &inst); Same here - } else if (type == CIM_RES_TYPE_INPUT) { - *s = get_pool_by_name(broker, - reference, - "InputPool/0", - &inst); + if ((s->rc == CMPI_RC_OK) && (list.cur > 0)) { + + for (i = 0; i < list.cur; i++) { + rc = cu_get_bool_prop(list.list[i], + "Primordial", + &val); + if ((rc != CMPI_RC_OK) || (val)) + continue; + + inst = list.list[i]; + break; + } Same here + } + + inst_list_free(&list); + + if (inst == NULL) { + cu_statusf(broker, s, + CMPI_RC_ERR_FAILED, + "No default pool found for type %hi", type); + } } else { - cu_statusf(broker, s, - CMPI_RC_ERR_INVALID_PARAMETER, - "No such device type `%s'", type); - } - - inst_list_free(&list); - - if (inst == NULL) { - cu_statusf(broker, s, - CMPI_RC_ERR_FAILED, - "No default pool found for type %hi", type); + inst = parent_device_pool(broker, reference, type, s); }
return inst; diff -r 570c3507c7b2 -r e132a8e94381 src/Virt_DevicePool.h --- a/src/Virt_DevicePool.h Tue May 05 18:08:58 2009 -0700 +++ b/src/Virt_DevicePool.h Mon Apr 27 17:05:48 2009 -0700 @@ -106,6 +106,20 @@ CMPIInstance **_inst);
/** + * Get the parent pool for a given device type + * + * @param broker A pointer to the current broker + * @param ref The object path containing namespace and prefix info + * @param type The device type in question + * @param status The returned status + * @returns Parent pool instance + */ +CMPIInstance *parent_device_pool(const CMPIBroker *broker, + const CMPIObjectPath *reference, + uint16_t type, + CMPIStatus *s); + +/** * Get the default pool for a given device type * * @param broker A pointer to the current broker
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim
-- Richard Maciel, MSc IBM Linux Technology Center rmaciel@linux.vnet.ibm.com

{ CMPIInstance *inst = NULL; struct inst_list list; + bool val;
- inst_list_init(&list); + if ((type == CIM_RES_TYPE_DISK) || (type == CIM_RES_TYPE_NET)) { + int i = 0; + CMPIrc rc;
- 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, "ProcessorPool/0", &inst); - } else if (type == CIM_RES_TYPE_DISK) { + inst_list_init(&list); + *s = enum_pools(broker, reference, type, &list); - if ((s->rc == CMPI_RC_OK) && (list.cur > 0))
You probably should insert a CU_DEBUG here just to help debug
The code bit above is being removed, not added.
- inst = list.list[0]; - } else if (type == CIM_RES_TYPE_NET) { - *s = enum_pools(broker, reference, type, &list); - if ((s->rc == CMPI_RC_OK) && (list.cur > 0)) - inst = list.list[0]; Same here
Same here - this code bit it being removed.
- } else if (type == CIM_RES_TYPE_GRAPHICS) { - *s = get_pool_by_name(broker, - reference, - "GraphicsPool/0", - &inst); Same here
It's been removed here as well.
- } else if (type == CIM_RES_TYPE_INPUT) { - *s = get_pool_by_name(broker, - reference, - "InputPool/0", - &inst); + if ((s->rc == CMPI_RC_OK) && (list.cur > 0)) { + + for (i = 0; i < list.cur; i++) { + rc = cu_get_bool_prop(list.list[i], + "Primordial", + &val); + if ((rc != CMPI_RC_OK) || (val)) + continue; + + inst = list.list[i]; + break; + } Same here
I'll fix this and send an updated patch. -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com

# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1240877148 25200 # Node ID 5608b9455cd32fccbc324cd540c509d7230a113f # Parent e132a8e94381d218d39eb2fffc94b27a438abb32 EAFP between parent and child pools. Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com> diff -r e132a8e94381 -r 5608b9455cd3 src/Virt_ElementAllocatedFromPool.c --- a/src/Virt_ElementAllocatedFromPool.c Mon Apr 27 17:05:48 2009 -0700 +++ b/src/Virt_ElementAllocatedFromPool.c Mon Apr 27 17:05:48 2009 -0700 @@ -89,18 +89,27 @@ free(poolid); return s; + } -static int filter_by_pool(struct inst_list *dest, - struct inst_list *src, - const uint16_t type, - const char *_poolid) +static CMPIStatus get_dev_from_pool(const CMPIObjectPath *ref, + const uint16_t type, + const char *_poolid, + struct inst_list *list) { + CMPIStatus s = {CMPI_RC_OK, NULL}; + char *poolid = NULL; + struct inst_list tmp; int i; - char *poolid = NULL; - for (i = 0; i < src->cur; i++) { - CMPIInstance *inst = src->list[i]; + inst_list_init(&tmp); + + s = enum_devices(_BROKER, ref, NULL, type, &tmp); + if (s.rc != CMPI_RC_OK) + goto out; + + for (i = 0; i < tmp.cur; i++) { + CMPIInstance *inst = tmp.list[i]; const char *cn = NULL; const char *dev_id = NULL; @@ -112,21 +121,76 @@ poolid = pool_member_of(_BROKER, cn, type, dev_id); if (poolid && STREQ(poolid, _poolid)) - inst_list_add(dest, inst); + inst_list_add(list, inst); } - return dest->cur; + inst_list_free(&tmp); + + out: + + return s; } -static CMPIStatus pool_to_vdev(const CMPIObjectPath *ref, - struct std_assoc_info *info, - struct inst_list *list) +static CMPIStatus get_pools(const CMPIObjectPath *ref, + const uint16_t type, + const char *poolid, + CMPIInstance *pool_inst, + struct inst_list *list) +{ + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIInstance *pool = NULL; + bool val; + + if (cu_get_bool_prop(pool_inst, "Primordial", &val) != CMPI_RC_OK) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to determine pool type"); + goto out; + } + + /* If Primordial is true, the pool is a parent pool. Need to return + all other pools. Otherwise, just return the parent pool. */ + if (val) { + struct inst_list tmp; + int i; + + inst_list_init(&tmp); + + s = enum_pools(_BROKER, ref, type, &tmp); + if (s.rc != CMPI_RC_OK) + goto out; + + for (i = 0; i < tmp.cur; i++) { + CMPIInstance *inst = tmp.list[i]; + const char *id = NULL; + + cu_get_str_prop(inst, "InstanceID", &id); + + if (!STREQC(id, poolid)) + inst_list_add(list, inst); + } + + inst_list_free(&tmp); + } else { + pool = parent_device_pool(_BROKER, ref, type, &s); + if (s.rc != CMPI_RC_OK) + goto out; + + inst_list_add(list, pool); + } + + out: + return s; +} + +static CMPIStatus pool_to_vdev_or_pool(const CMPIObjectPath *ref, + struct std_assoc_info *info, + struct inst_list *list) { const char *poolid; CMPIStatus s = {CMPI_RC_OK, NULL}; uint16_t type; CMPIInstance *inst = NULL; - struct inst_list tmp; if (!match_hypervisor_prefix(ref, info)) return s; @@ -150,15 +214,11 @@ goto out; } - inst_list_init(&tmp); - - s = enum_devices(_BROKER, ref, NULL, type, &tmp); + s = get_dev_from_pool(ref, type, poolid, list); if (s.rc != CMPI_RC_OK) goto out; - filter_by_pool(list, &tmp, type, poolid); - - inst_list_free(&tmp); + s = get_pools(ref, type, poolid, inst, list); out: return s; @@ -166,7 +226,7 @@ LIBVIRT_CIM_DEFAULT_MAKEREF() -static char* antecedent[] = { +static char* pool[] = { "Xen_ProcessorPool", "Xen_MemoryPool", "Xen_NetworkPool", @@ -188,7 +248,7 @@ NULL }; -static char* dependent[] = { +static char* device[] = { "Xen_Processor", "Xen_Memory", "Xen_NetworkPort", @@ -210,6 +270,46 @@ NULL }; +static char* device_or_pool[] = { + "Xen_Processor", + "Xen_Memory", + "Xen_NetworkPort", + "Xen_LogicalDisk", + "Xen_DisplayController", + "Xen_PointingDevice", + "KVM_Processor", + "KVM_Memory", + "KVM_NetworkPort", + "KVM_LogicalDisk", + "KVM_DisplayController", + "KVM_PointingDevice", + "LXC_Processor", + "LXC_Memory", + "LXC_NetworkPort", + "LXC_LogicalDisk", + "LXC_DisplayController", + "LXC_PointingDevice", + "Xen_ProcessorPool", + "Xen_MemoryPool", + "Xen_NetworkPool", + "Xen_DiskPool", + "Xen_GraphicsPool", + "Xen_InputPool", + "KVM_ProcessorPool", + "KVM_MemoryPool", + "KVM_NetworkPool", + "KVM_DiskPool", + "KVM_GraphicsPool", + "KVM_InputPool", + "LXC_ProcessorPool", + "LXC_MemoryPool", + "LXC_NetworkPool", + "LXC_DiskPool", + "LXC_GraphicsPool", + "LXC_InputPool", + NULL +}; + static char* assoc_classname[] = { "Xen_ElementAllocatedFromPool", "KVM_ElementAllocatedFromPool", @@ -218,10 +318,10 @@ }; static struct std_assoc _vdev_to_pool = { - .source_class = (char**)&dependent, + .source_class = (char**)&device, .source_prop = "Dependent", - .target_class = (char**)&antecedent, + .target_class = (char**)&pool, .target_prop = "Antecedent", .assoc_class = (char**)&assoc_classname, @@ -230,22 +330,22 @@ .make_ref = make_ref }; -static struct std_assoc _pool_to_vdev = { - .source_class = (char**)&antecedent, +static struct std_assoc _pool_to_vdev_or_pool = { + .source_class = (char**)&pool, .source_prop = "Antecedent", - .target_class = (char**)&dependent, + .target_class = (char**)&device_or_pool, .target_prop = "Dependent", .assoc_class = (char**)&assoc_classname, - .handler = pool_to_vdev, + .handler = pool_to_vdev_or_pool, .make_ref = make_ref }; static struct std_assoc *handlers[] = { &_vdev_to_pool, - &_pool_to_vdev, + &_pool_to_vdev_or_pool, NULL };

Kaitlin Rupert wrote:
# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1240877148 25200 # Node ID 5608b9455cd32fccbc324cd540c509d7230a113f # Parent e132a8e94381d218d39eb2fffc94b27a438abb32 EAFP between parent and child pools.
Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com>
diff -r e132a8e94381 -r 5608b9455cd3 src/Virt_ElementAllocatedFromPool.c --- a/src/Virt_ElementAllocatedFromPool.c Mon Apr 27 17:05:48 2009 -0700 +++ b/src/Virt_ElementAllocatedFromPool.c Mon Apr 27 17:05:48 2009 -0700 @@ -89,18 +89,27 @@ free(poolid);
return s; + }
-static int filter_by_pool(struct inst_list *dest, - struct inst_list *src, - const uint16_t type, - const char *_poolid) +static CMPIStatus get_dev_from_pool(const CMPIObjectPath *ref, + const uint16_t type, + const char *_poolid, + struct inst_list *list) { + CMPIStatus s = {CMPI_RC_OK, NULL}; + char *poolid = NULL; + struct inst_list tmp; int i; - char *poolid = NULL;
- for (i = 0; i < src->cur; i++) { - CMPIInstance *inst = src->list[i]; + inst_list_init(&tmp); + + s = enum_devices(_BROKER, ref, NULL, type, &tmp); + if (s.rc != CMPI_RC_OK)
Same problem here. Use a CU_DEBUG to register in the log that enum_devices actually failed
+ goto out; + + for (i = 0; i < tmp.cur; i++) { + CMPIInstance *inst = tmp.list[i]; const char *cn = NULL; const char *dev_id = NULL;
@@ -112,21 +121,76 @@
poolid = pool_member_of(_BROKER, cn, type, dev_id); if (poolid && STREQ(poolid, _poolid)) - inst_list_add(dest, inst); + inst_list_add(list, inst); }
- return dest->cur; + inst_list_free(&tmp); + + out: + + return s; }
-static CMPIStatus pool_to_vdev(const CMPIObjectPath *ref, - struct std_assoc_info *info, - struct inst_list *list) +static CMPIStatus get_pools(const CMPIObjectPath *ref, + const uint16_t type, + const char *poolid, + CMPIInstance *pool_inst, + struct inst_list *list) +{ + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIInstance *pool = NULL; + bool val; + + if (cu_get_bool_prop(pool_inst, "Primordial", &val) != CMPI_RC_OK) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to determine pool type"); + goto out; + } + + /* If Primordial is true, the pool is a parent pool. Need to return + all other pools. Otherwise, just return the parent pool. */ + if (val) { + struct inst_list tmp; + int i; + + inst_list_init(&tmp); + + s = enum_pools(_BROKER, ref, type, &tmp); + if (s.rc != CMPI_RC_OK) Add CU_DEBUG notification here + goto out; + + for (i = 0; i < tmp.cur; i++) { + CMPIInstance *inst = tmp.list[i]; + const char *id = NULL; + + cu_get_str_prop(inst, "InstanceID", &id); + + if (!STREQC(id, poolid)) + inst_list_add(list, inst); + } + + inst_list_free(&tmp); + } else { + pool = parent_device_pool(_BROKER, ref, type, &s); + if (s.rc != CMPI_RC_OK) Add CU_DEBUG notification here + goto out; + + inst_list_add(list, pool); + } + + out: + return s; +} + +static CMPIStatus pool_to_vdev_or_pool(const CMPIObjectPath *ref, + struct std_assoc_info *info, + struct inst_list *list) { const char *poolid; CMPIStatus s = {CMPI_RC_OK, NULL}; uint16_t type; CMPIInstance *inst = NULL; - struct inst_list tmp;
if (!match_hypervisor_prefix(ref, info)) return s; @@ -150,15 +214,11 @@ Add CU_DEBUG notification here goto out; }
- inst_list_init(&tmp); - - s = enum_devices(_BROKER, ref, NULL, type, &tmp); + s = get_dev_from_pool(ref, type, poolid, list); if (s.rc != CMPI_RC_OK) Add CU_DEBUG notification here goto out;
- filter_by_pool(list, &tmp, type, poolid); - - inst_list_free(&tmp); + s = get_pools(ref, type, poolid, inst, list);
out: return s; @@ -166,7 +226,7 @@
LIBVIRT_CIM_DEFAULT_MAKEREF()
-static char* antecedent[] = { +static char* pool[] = { "Xen_ProcessorPool", "Xen_MemoryPool", "Xen_NetworkPool", @@ -188,7 +248,7 @@ NULL };
-static char* dependent[] = { +static char* device[] = { "Xen_Processor", "Xen_Memory", "Xen_NetworkPort", @@ -210,6 +270,46 @@ NULL };
+static char* device_or_pool[] = { + "Xen_Processor", + "Xen_Memory", + "Xen_NetworkPort", + "Xen_LogicalDisk", + "Xen_DisplayController", + "Xen_PointingDevice", + "KVM_Processor", + "KVM_Memory", + "KVM_NetworkPort", + "KVM_LogicalDisk", + "KVM_DisplayController", + "KVM_PointingDevice", + "LXC_Processor", + "LXC_Memory", + "LXC_NetworkPort", + "LXC_LogicalDisk", + "LXC_DisplayController", + "LXC_PointingDevice", + "Xen_ProcessorPool", + "Xen_MemoryPool", + "Xen_NetworkPool", + "Xen_DiskPool", + "Xen_GraphicsPool", + "Xen_InputPool", + "KVM_ProcessorPool", + "KVM_MemoryPool", + "KVM_NetworkPool", + "KVM_DiskPool", + "KVM_GraphicsPool", + "KVM_InputPool", + "LXC_ProcessorPool", + "LXC_MemoryPool", + "LXC_NetworkPool", + "LXC_DiskPool", + "LXC_GraphicsPool", + "LXC_InputPool", + NULL +}; + static char* assoc_classname[] = { "Xen_ElementAllocatedFromPool", "KVM_ElementAllocatedFromPool", @@ -218,10 +318,10 @@ };
static struct std_assoc _vdev_to_pool = { - .source_class = (char**)&dependent, + .source_class = (char**)&device, .source_prop = "Dependent",
- .target_class = (char**)&antecedent, + .target_class = (char**)&pool, .target_prop = "Antecedent",
.assoc_class = (char**)&assoc_classname, @@ -230,22 +330,22 @@ .make_ref = make_ref };
-static struct std_assoc _pool_to_vdev = { - .source_class = (char**)&antecedent, +static struct std_assoc _pool_to_vdev_or_pool = { + .source_class = (char**)&pool, .source_prop = "Antecedent",
- .target_class = (char**)&dependent, + .target_class = (char**)&device_or_pool, .target_prop = "Dependent",
.assoc_class = (char**)&assoc_classname,
- .handler = pool_to_vdev, + .handler = pool_to_vdev_or_pool, .make_ref = make_ref };
static struct std_assoc *handlers[] = { &_vdev_to_pool, - &_pool_to_vdev, + &_pool_to_vdev_or_pool, NULL };
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim
-- Richard Maciel, MSc IBM Linux Technology Center rmaciel@linux.vnet.ibm.com
participants (2)
-
Kaitlin Rupert
-
Richard Maciel