# HG changeset patch
# User Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
# Date 1197378558 -3600
# Node ID 838bd46416cc73ddf67eadce7dbda852927832ed
# Parent 6fdfdb1a22c5f790cfd08538a3e29923ccd2237c
SDC: returned instances are not of type specific subclass
Signed-off-by: Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
diff -r 6fdfdb1a22c5 -r 838bd46416cc src/Virt_SettingsDefineCapabilities.c
--- a/src/Virt_SettingsDefineCapabilities.c Mon Dec 10 13:28:51 2007 -0800
+++ b/src/Virt_SettingsDefineCapabilities.c Tue Dec 11 14:09:18 2007 +0100
@@ -659,6 +659,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. */
@@ -705,10 +706,26 @@ static CMPIInstance *sdc_rasd_inst(const
if (s->rc != CMPI_RC_OK)
goto out;
- inst = get_typed_instance(broker,
- CLASSNAME(ref),
- "ResourceAllocationSettingData",
- NAMESPACE(ref));
+ 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;
+ }
+
+ if (base)
+ inst = get_typed_instance(broker,
+ CLASSNAME(ref),
+ base,
+ NAMESPACE(ref));
CMSetProperty(inst, "InstanceID", inst_id, CMPI_chars);
CMSetProperty(inst, "PropertyPolicy", &policy, CMPI_uint16);