# HG changeset patch
# User Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
# Date 1197625019 -3600
# Node ID fed85a12807e46622ffea62938173db4b56706a4
# Parent 1e73930c047813c85341f2c2be32903c466cc336
SDC: returned instances are not of type specific subclass
Signed-off-by: Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
diff -r 1e73930c0478 -r fed85a12807e src/Virt_SettingsDefineCapabilities.c
--- a/src/Virt_SettingsDefineCapabilities.c Fri Dec 14 10:36:03 2007 +0100
+++ b/src/Virt_SettingsDefineCapabilities.c Fri Dec 14 10:36:59 2007 +0100
@@ -42,6 +42,7 @@
#include "Virt_SettingsDefineCapabilities.h"
#include "Virt_DevicePool.h"
+#include "Virt_RASD.h"
const static CMPIBroker *_BROKER;
@@ -658,6 +659,7 @@ static CMPIInstance *sdc_rasd_inst(const
struct sdc_rasd_prop *prop_list;
int i;
char *inst_id;
+ const char *base = NULL;
uint16_t resource_type;
/* Defaults for the following are from
CIM_SettingsDefineCapabilities.mof. */
@@ -704,9 +706,16 @@ static CMPIInstance *sdc_rasd_inst(const
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 err;
+ }
+
inst = get_typed_instance(broker,
CLASSNAME(ref),
- "ResourceAllocationSettingData",
+ base,
NAMESPACE(ref));
CMSetProperty(inst, "InstanceID", inst_id, CMPI_chars);
@@ -723,6 +732,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: