# HG changeset patch
# User Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
# Date 1197624963 -3600
# Node ID 1e73930c047813c85341f2c2be32903c466cc336
# Parent 86999a1e8fac6f6cee5ca62a4005ca37759713ff
RASD: Added helper function to check for the given resource type
Signed-off-by: Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
diff -r 86999a1e8fac -r 1e73930c0478 src/Virt_RASD.c
--- a/src/Virt_RASD.c Wed Dec 12 17:22:06 2007 -0800
+++ b/src/Virt_RASD.c Fri Dec 14 10:36:03 2007 +0100
@@ -239,6 +239,30 @@ CMPIrc rasd_type_from_classname(const ch
return rc;
}
+CMPIrc rasd_classname_from_type(uint16_t type, const char **classname)
+{
+ CMPIrc rc = CMPI_RC_OK;
+
+ switch(type) {
+ case CIM_RASD_TYPE_MEM:
+ *classname = "MemResourceAllocationSettingData";
+ break;
+ case CIM_RASD_TYPE_PROC:
+ *classname = "ProcResourceAllocationSettingData";
+ break;
+ case CIM_RASD_TYPE_NET:
+ *classname = "NetResourceAllocationSettingData";
+ break;
+ case CIM_RASD_TYPE_DISK:
+ *classname = "DiskResourceAllocationSettingData";
+ break;
+ default:
+ rc = CMPI_RC_ERR_FAILED;
+ }
+
+ return rc;
+}
+
static CMPIStatus GetInstance(CMPIInstanceMI *self,
const CMPIContext *context,
const CMPIResult *results,
diff -r 86999a1e8fac -r 1e73930c0478 src/Virt_RASD.h
--- a/src/Virt_RASD.h Wed Dec 12 17:22:06 2007 -0800
+++ b/src/Virt_RASD.h Fri Dec 14 10:36:03 2007 +0100
@@ -40,6 +40,7 @@ int rasds_for_domain(const CMPIBroker *b
struct inst_list *_list);
CMPIrc rasd_type_from_classname(const char *cn, uint16_t *type);
+CMPIrc rasd_classname_from_type(uint16_t type, const char **cn);
CMPIInstance *get_rasd_instance(const CMPIContext *context,
const CMPIObjectPath *ref,