# HG changeset patch
# User Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
# Date 1197881325 -3600
# Node ID c22a61c0852055c920f46ffe82ab5761c7240444
# Parent 109fd77699732a1bc2969b93d9a799c446b3f4c0
SDC: returned instances are not of type specific subclass
Signed-off-by: Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
diff -r 109fd7769973 -r c22a61c08520 src/Virt_SettingsDefineCapabilities.c
--- a/src/Virt_SettingsDefineCapabilities.c Mon Dec 17 09:48:44 2007 +0100
+++ b/src/Virt_SettingsDefineCapabilities.c Mon Dec 17 09:48:45 2007 +0100
@@ -42,6 +42,7 @@
#include "Virt_SettingsDefineCapabilities.h"
#include "Virt_DevicePool.h"
+#include "Virt_RASD.h"
const static CMPIBroker *_BROKER;
@@ -657,9 +658,10 @@ static CMPIInstance *sdc_rasd_inst(const
sdc_rasd_type type)
{
CMPIInstance *inst = NULL;
- struct sdc_rasd_prop *prop_list;
+ struct sdc_rasd_prop *prop_list = NULL;
int i;
- char *inst_id;
+ char *inst_id = NULL;
+ const char *base = NULL;
uint16_t resource_type;
/* Defaults for the following are from
CIM_SettingsDefineCapabilities.mof. */
@@ -700,15 +702,21 @@ static CMPIInstance *sdc_rasd_inst(const
cu_statusf(broker, s,
CMPI_RC_ERR_FAILED,
"Unsupported sdc_rasd type");
- goto out;
}
if (s->rc != CMPI_RC_OK)
goto out;
+
+ if (rasd_classname_from_type(rasd->resource_type, &base) != CMPI_RC_OK) {
+ cu_statusf(broker, s,
+ CMPI_RC_ERR_FAILED,
+ "Resource type not known");
+ goto out;
+ }
inst = get_typed_instance(broker,
CLASSNAME(ref),
- "ResourceAllocationSettingData",
+ base,
NAMESPACE(ref));
CMSetProperty(inst, "InstanceID", inst_id, CMPI_chars);
@@ -725,10 +733,8 @@ static CMPIInstance *sdc_rasd_inst(const
prop_list[i].value, prop_list[i].type);
}
- CU_DEBUG("freeing prop_list");
+ out:
free_rasd_prop_list(prop_list);
- out:
- CU_DEBUG("Returning inst");
return inst;
}