
# HG changeset patch # User Heidi Eckhart <heidieck@linux.vnet.ibm.com> # Date 1204709618 -3600 # Node ID dfd9e623fef6ec927b06ab546857765b47482f87 # Parent ee7aecb09ec486d4d47134fef328ae207b608e1d RAFP: adopt DevicePool interface changes - adopted changes to DevicePool interface Signed-off-by: Heidi Eckhart <heidieck@linux.vnet.ibm.com> diff -r ee7aecb09ec4 -r dfd9e623fef6 src/Virt_ResourceAllocationFromPool.c --- a/src/Virt_ResourceAllocationFromPool.c Wed Mar 05 10:33:37 2008 +0100 +++ b/src/Virt_ResourceAllocationFromPool.c Wed Mar 05 10:33: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; }