[Libvirt-cim] [PATCH 3 of 6] SDC: adopt DevicePool interface change

Heidi Eckhart heidieck at linux.vnet.ibm.com
Fri Mar 7 12:24:03 UTC 2008


# HG changeset patch
# User Heidi Eckhart <heidieck at linux.vnet.ibm.com>
# Date 1204892339 -3600
# Node ID 4da19a424fba43ed9683fcb10721f3b9ac566f95
# Parent  a8173158176010511273e25c70f4b9fec27ccfb2
SDC: adopt DevicePool interface change

- adopted changes to DevicePool interface

Signed-off-by: Heidi Eckhart <heidieck at linux.vnet.ibm.com>

diff -r a81731581760 -r 4da19a424fba src/Virt_SettingsDefineCapabilities.c
--- a/src/Virt_SettingsDefineCapabilities.c	Fri Mar 07 13:18:58 2008 +0100
+++ b/src/Virt_SettingsDefineCapabilities.c	Fri Mar 07 13:18:59 2008 +0100
@@ -529,13 +529,9 @@ static struct sdc_rasd_prop *disk_max(co
 
         /* Getting the relevant resource pool directly finds the free space 
            for us.  It is in the Capacity field. */
-        pool_inst = get_pool_by_id(_BROKER, conn, inst_id, NAMESPACE(ref));
-        if (pool_inst == NULL) {
-                cu_statusf(_BROKER, s, 
-                           CMPI_RC_ERR_FAILED,
-                           "Could not get pool instance");
-                goto out;
-        }
+        *s = get_pool_by_name(_BROKER, ref, inst_id, &pool_inst);
+        if (s->rc != CMPI_RC_OK)
+                goto out;
 
         prop_ret = cu_get_u64_prop(pool_inst, "Capacity", &free_64);
         if (prop_ret != CMPI_RC_OK) {
@@ -794,8 +790,6 @@ static CMPIStatus alloc_cap_to_rasd(cons
         if (!match_hypervisor_prefix(ref, info))
                 return s;
 
-        CU_DEBUG("Getting ResourceType");
-
         if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) {
                 cu_statusf(_BROKER, &s,
                            CMPI_RC_ERR_FAILED,
@@ -803,9 +797,7 @@ static CMPIStatus alloc_cap_to_rasd(cons
                 goto out;
         }
  
-        type = device_type_from_poolid(id);
-
-        CU_DEBUG("ResourceType: %hi", type);
+        type = res_type_from_pool_id(id);
 
         if (type == CIM_RES_TYPE_UNKNOWN) {
                 cu_statusf(_BROKER, &s,




More information about the Libvirt-cim mailing list