# HG changeset patch
# User Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
# Date 1204546778 -3600
# Node ID 0110c5e63a7f4ed7bc556dacb407dba8a0f1380d
# Parent 4166fe782224243c171c9dc8c08e95a447177736
RAFP: adopt DevicePool interface changes
Signed-off-by: Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
diff -r 4166fe782224 -r 0110c5e63a7f src/Virt_ResourceAllocationFromPool.c
--- a/src/Virt_ResourceAllocationFromPool.c Mon Mar 03 13:10:28 2008 +0100
+++ b/src/Virt_ResourceAllocationFromPool.c Mon Mar 03 13:19:38 2008 +0100
@@ -45,7 +45,6 @@ static CMPIStatus rasd_to_pool(const CMP
uint16_t type;
const char *id = NULL;
char *poolid = NULL;
- virConnectPtr conn = NULL;
CMPIInstance *pool = NULL;
CMPIInstance *inst = NULL;
@@ -78,28 +77,17 @@ static CMPIStatus rasd_to_pool(const CMP
goto out;
}
- conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s);
- if (conn == NULL)
- goto out;
-
- pool = get_pool_by_id(_BROKER,
- conn,
- poolid,
- NAMESPACE(ref));
- if (pool != NULL) {
- inst_list_add(list, pool);
- cu_statusf(_BROKER, &s,
- CMPI_RC_OK,
- "");
- } else {
- cu_statusf(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "Unable to find pool `%s'", poolid);
- }
+ s = get_pool_by_name(_BROKER,
+ ref,
+ poolid,
+ &pool);
+ if (s.rc != CMPI_RC_OK)
+ goto out;
+
+ inst_list_add(list, pool);
out:
free(poolid);
- virConnectClose(conn);
return s;
}
@@ -191,7 +179,11 @@ static CMPIStatus pool_to_rasd(const CMP
CMPIInstance *inst;
if (!match_hypervisor_prefix(ref, info))
- return s;
+ goto out;
+
+ s = get_pool_by_ref(_BROKER, ref, &inst);
+ if (s.rc != CMPI_RC_OK)
+ goto out;
if (cu_get_str_path(ref, "InstanceID", &poolid) != CMPI_RC_OK) {
cu_statusf(_BROKER, &s,
@@ -207,10 +199,6 @@ static CMPIStatus pool_to_rasd(const CMP
"Invalid InstanceID or unsupported pool type");
goto out;
}
-
- s = get_pool_inst(_BROKER, ref, &inst);
- if ((s.rc != CMPI_RC_OK) || (inst == NULL))
- goto out;
rasds_from_pool(type,
ref,
@@ -218,9 +206,6 @@ static CMPIStatus pool_to_rasd(const CMP
info->properties,
list);
- cu_statusf(_BROKER, &s,
- CMPI_RC_OK,
- "");
out:
return s;
}