[Libvirt-cim] [PATCH 07 of 10] HRP: adopt DevicePool interface change

Heidi Eckhart heidieck at linux.vnet.ibm.com
Thu Mar 6 12:31:48 UTC 2008


# HG changeset patch
# User Heidi Eckhart <heidieck at linux.vnet.ibm.com>
# Date 1204797487 -3600
# Node ID ea35090f8613c2a6af6993bd02cbfed709792110
# Parent  8eee311470e991e9ed8ebdef20e863c6f738ecf9
HRP: adopt DevicePool interface change

- adopted changes to DevicePool interface

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

diff -r 8eee311470e9 -r ea35090f8613 src/Virt_HostedResourcePool.c
--- a/src/Virt_HostedResourcePool.c	Thu Mar 06 10:58:07 2008 +0100
+++ b/src/Virt_HostedResourcePool.c	Thu Mar 06 10:58:07 2008 +0100
@@ -34,6 +34,7 @@
 
 #include "Virt_HostSystem.h"
 #include "Virt_DevicePool.h"
+#include "svpc_types.h"
 
 static const CMPIBroker *_BROKER;
 
@@ -47,8 +48,8 @@ static CMPIStatus pool_to_sys(const CMPI
         if (!match_hypervisor_prefix(ref, info))
                 goto out;
 
-        s = get_pool_inst(_BROKER, ref, &inst);
-        if ((s.rc != CMPI_RC_OK) || (inst == NULL))
+        s = get_pool_by_ref(_BROKER, ref, &inst);
+        if (s.rc != CMPI_RC_OK)
                 goto out;
 
         s = get_host(_BROKER, ref, &inst, false);
@@ -67,26 +68,15 @@ static CMPIStatus sys_to_pool(const CMPI
 {
         CMPIStatus s = {CMPI_RC_OK, NULL};
         CMPIInstance *inst = NULL;
-        int i;
-        virConnectPtr conn;
 
         if (!match_hypervisor_prefix(ref, info))
                 goto out;
-
+        
         s = get_host(_BROKER, ref, &inst, true);
         if (s.rc != CMPI_RC_OK)
                 goto out;
 
-        conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s);
-        if (conn == NULL)
-                goto out;
-
-        for (i = 0; device_pool_names[i]; i++)
-                get_pool_by_type(_BROKER,
-                                 conn,
-                                 device_pool_names[i],
-                                 NAMESPACE(ref),
-                                 list);
+        s = enum_pools(_BROKER, ref, CIM_RES_TYPE_ALL, list);
 
  out:
         return s;




More information about the Libvirt-cim mailing list