# HG changeset patch
# User Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
# Date 1204892344 -3600
# Node ID 29a9dd30a48b19e26edeb2a1ed030e4244674f97
# Parent 5035a40ceb863e53e7b33dcc12e5a7571bbcc1d3
VSSDC: adopt RASD interface changes
Signed-off-by: Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
diff -r 5035a40ceb86 -r 29a9dd30a48b src/Virt_VSSDComponent.c
--- a/src/Virt_VSSDComponent.c Fri Mar 07 13:19:03 2008 +0100
+++ b/src/Virt_VSSDComponent.c Fri Mar 07 13:19:04 2008 +0100
@@ -43,14 +43,6 @@ static CMPIStatus vssd_to_rasd(const CMP
CMPIStatus s = {CMPI_RC_OK, NULL};
CMPIInstance *inst = NULL;
char *name = NULL;
- int i = 0;
- int types[] = {
- CIM_RES_TYPE_PROC,
- CIM_RES_TYPE_NET,
- CIM_RES_TYPE_DISK,
- CIM_RES_TYPE_MEM,
- -1
- };
if (!match_hypervisor_prefix(ref, info))
goto out;
@@ -66,14 +58,12 @@ static CMPIStatus vssd_to_rasd(const CMP
goto out;
}
- for (i = 0; types[i] > 0; i++) {
- rasds_for_domain(_BROKER,
- name,
- types[i],
- ref,
- info->properties,
- list);
- }
+ s = enum_rasds(_BROKER,
+ ref,
+ name,
+ CIM_RES_TYPE_ALL,
+ info->properties,
+ list);
free(name);
@@ -86,7 +76,7 @@ static CMPIStatus rasd_to_vssd(const CMP
struct inst_list *list)
{
CMPIStatus s = {CMPI_RC_OK, NULL};
- CMPIInstance *vssd = NULL;
+ CMPIInstance *inst = NULL;
const char *id = NULL;
char *host = NULL;
char *devid = NULL;
@@ -94,6 +84,10 @@ static CMPIStatus rasd_to_vssd(const CMP
if (!match_hypervisor_prefix(ref, info))
return s;
+
+ s = get_rasd_by_ref(_BROKER, ref, info->properties, &inst);
+ if (s.rc != CMPI_RC_OK)
+ goto out;
if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) {
cu_statusf(_BROKER, &s,
@@ -110,11 +104,11 @@ static CMPIStatus rasd_to_vssd(const CMP
goto out;
}
- s = get_vssd_by_name(_BROKER, ref, host, &vssd);
+ s = get_vssd_by_name(_BROKER, ref, host, &inst);
if (s.rc != CMPI_RC_OK)
goto out;
- inst_list_add(list, vssd);
+ inst_list_add(list, inst);
out:
free(host);