# HG changeset patch
# User Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
# Date 1204806483 -3600
# Node ID 81c2aba96aff5c3177c86cb1dc08d88b52c3897f
# Parent 7bb967966c0c44c4ab7b89a4f3bf7c82301a4711
VSSDC: adopt RASD interface changes
Signed-off-by: Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
diff -r 7bb967966c0c -r 81c2aba96aff src/Virt_VSSDComponent.c
--- a/src/Virt_VSSDComponent.c Thu Mar 06 13:28:03 2008 +0100
+++ b/src/Virt_VSSDComponent.c Thu Mar 06 13:28:03 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,8 @@ 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 +72,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 +80,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 +100,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);