
# HG changeset patch # User Dan Smith <danms@us.ibm.com> # Date 1195492220 28800 # Node ID 63881b803abfa7a291082191fb245f26731c7d7c # Parent 59abf0e63644d8c306492645f9291718c35e40d5 Make ElementAllocatedFromPool use connect_by_classname() Signed-off-by: Dan Smith <danms@us.ibm.com> diff -r 59abf0e63644 -r 63881b803abf src/Virt_ElementAllocatedFromPool.c --- a/src/Virt_ElementAllocatedFromPool.c Mon Nov 19 09:04:50 2007 -0800 +++ b/src/Virt_ElementAllocatedFromPool.c Mon Nov 19 09:10:20 2007 -0800 @@ -92,7 +92,7 @@ static CMPIStatus vdev_to_pool(const CMP goto out; } - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); if (conn == NULL) goto out; @@ -147,7 +147,7 @@ static int filter_by_pool(struct inst_li } static int devs_from_pool(uint16_t type, - const char *ns, + const CMPIObjectPath *ref, const char *poolid, struct inst_list *list) { @@ -156,8 +156,10 @@ static int devs_from_pool(uint16_t type, virDomainPtr *doms = NULL; int count; int i; - - conn = lv_connect(_BROKER, &s); + const char *ns = NAMESPACE(ref); + const char *cn = CLASSNAME(ref); + + conn = connect_by_classname(_BROKER, cn, &s); if (conn == NULL) return 0; @@ -200,7 +202,6 @@ static CMPIStatus pool_to_vdev(const CMP { char *poolid; CMPIStatus s; - const char *ns = NAMESPACE(ref); poolid = cu_get_str_path(ref, "InstanceID"); if (poolid == NULL) { @@ -215,22 +216,22 @@ static CMPIStatus pool_to_vdev(const CMP /* FIXME, make this shared with the RAFP version */ if (STARTS_WITH(poolid, "ProcessorPool")) devs_from_pool(CIM_RASD_TYPE_PROC, - ns, + ref, poolid, list); else if (STARTS_WITH(poolid, "MemoryPool")) devs_from_pool(CIM_RASD_TYPE_MEM, - ns, + ref, poolid, list); else if (STARTS_WITH(poolid, "NetworkPool")) devs_from_pool(CIM_RASD_TYPE_NET, - ns, + ref, poolid, list); else if (STARTS_WITH(poolid, "DiskPool")) devs_from_pool(CIM_RASD_TYPE_DISK, - ns, + ref, poolid, list); else {