# HG changeset patch
# User Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
# Date 1205156447 -3600
# Node ID 1325969aff7f736a9b17b4cd259f9608890d11bf
# Parent f82efd4364f1f27c1ec7ceaedafc281379007b38
Add iteration functionality for CIM_RES_TYPE_ALL
Signed-off-by: Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
diff -r f82efd4364f1 -r 1325969aff7f src/Virt_Device.c
--- a/src/Virt_Device.c Fri Mar 07 15:24:38 2008 -0800
+++ b/src/Virt_Device.c Mon Mar 10 14:40:47 2008 +0100
@@ -322,28 +322,15 @@ static CMPIStatus _enum_devices(const CM
struct inst_list *list)
{
CMPIStatus s;
+ int i;
if (type == CIM_RES_TYPE_ALL) {
- s = _get_devices(broker,
- reference,
- dom,
- CIM_RES_TYPE_PROC,
- list);
- s = _get_devices(broker,
- reference,
- dom,
- CIM_RES_TYPE_NET,
- list);
- s = _get_devices(broker,
- reference,
- dom,
- CIM_RES_TYPE_MEM,
- list);
- s = _get_devices(broker,
- reference,
- dom,
- CIM_RES_TYPE_DISK,
- list);
+ for (i=0; i<CIM_RES_TYPE_COUNT; i++)
+ s = _get_devices(broker,
+ reference,
+ dom,
+ cim_res_types[i],
+ list);
}
else
s = _get_devices(broker,
diff -r f82efd4364f1 -r 1325969aff7f src/Virt_RASD.c
--- a/src/Virt_RASD.c Fri Mar 07 15:24:38 2008 -0800
+++ b/src/Virt_RASD.c Mon Mar 10 14:40:47 2008 +0100
@@ -562,32 +562,16 @@ static CMPIStatus _enum_rasds(const CMPI
struct inst_list *list)
{
CMPIStatus s;
+ int i;
if (type == CIM_RES_TYPE_ALL) {
- s = _get_rasds(broker,
- reference,
- dom,
- CIM_RES_TYPE_PROC,
- properties,
- list);
- s = _get_rasds(broker,
- reference,
- dom,
- CIM_RES_TYPE_MEM,
- properties,
- list);
- s = _get_rasds(broker,
- reference,
- dom,
- CIM_RES_TYPE_NET,
- properties,
- list);
- s = _get_rasds(broker,
- reference,
- dom,
- CIM_RES_TYPE_DISK,
- properties,
- list);
+ for (i=0; i<CIM_RES_TYPE_COUNT; i++)
+ s = _get_rasds(broker,
+ reference,
+ dom,
+ cim_res_types[i],
+ properties,
+ list);
}
else
s = _get_rasds(broker,
diff -r f82efd4364f1 -r 1325969aff7f src/svpc_types.h
--- a/src/svpc_types.h Fri Mar 07 15:24:38 2008 -0800
+++ b/src/svpc_types.h Mon Mar 10 14:40:47 2008 +0100
@@ -30,6 +30,14 @@
#define CIM_RES_TYPE_EMU 1
#define CIM_RES_TYPE_GRAPHICS 24
#define CIM_RES_TYPE_UNKNOWN 1000
+
+#define CIM_RES_TYPE_COUNT 4
+const static int cim_res_types[CIM_RES_TYPE_COUNT] =
+ {CIM_RES_TYPE_NET,
+ CIM_RES_TYPE_DISK,
+ CIM_RES_TYPE_MEM,
+ CIM_RES_TYPE_PROC,
+ };
#define CIM_VSSD_RECOVERY_NONE 2
#define CIM_VSSD_RECOVERY_RESTART 3