# HG changeset patch
# User Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
# Date 1197543884 -3600
# Node ID 733f1e73fe50ea102d9c8942e3dfb0bbca2e6f91
# Parent 86999a1e8fac6f6cee5ca62a4005ca37759713ff
SDC: returned instances are not of type specific subclass
Signed-off-by: Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
diff -r 86999a1e8fac -r 733f1e73fe50 src/Virt_SettingsDefineCapabilities.c
--- a/src/Virt_SettingsDefineCapabilities.c Wed Dec 12 17:22:06 2007 -0800
+++ b/src/Virt_SettingsDefineCapabilities.c Thu Dec 13 12:04:44 2007 +0100
@@ -658,6 +658,7 @@ static CMPIInstance *sdc_rasd_inst(const
struct sdc_rasd_prop *prop_list;
int i;
char *inst_id;
+ char *base = NULL;
uint16_t resource_type;
/* Defaults for the following are from
CIM_SettingsDefineCapabilities.mof. */
@@ -704,9 +705,29 @@ static CMPIInstance *sdc_rasd_inst(const
if (s->rc != CMPI_RC_OK)
goto out;
+ switch(rasd->resource_type) {
+ case CIM_RASD_TYPE_MEM:
+ base = "MemResourceAllocationSettingData";
+ break;
+ case CIM_RASD_TYPE_PROC:
+ base = "ProcResourceAllocationSettingData";
+ break;
+ case CIM_RASD_TYPE_NET:
+ base = "NetResourceAllocationSettingData";
+ break;
+ case CIM_RASD_TYPE_DISK:
+ base = "DiskResourceAllocationSettingData";
+ break;
+ default:
+ cu_statusf(broker, s,
+ CMPI_RC_ERR_FAILED,
+ "Resource type not known");
+ goto err;
+ }
+
inst = get_typed_instance(broker,
CLASSNAME(ref),
- "ResourceAllocationSettingData",
+ base,
NAMESPACE(ref));
CMSetProperty(inst, "InstanceID", inst_id, CMPI_chars);
@@ -723,6 +744,7 @@ static CMPIInstance *sdc_rasd_inst(const
prop_list[i].value, prop_list[i].type);
}
+ err:
CU_DEBUG("freeing prop_list");
free_rasd_prop_list(prop_list);
out: