# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1196199121 28800
# Node ID d9fa7a6eb180e5489209a7b893e40c15ad0f1943
# Parent 651039e9392c60f96b6cbaa63f0a239df5357550
Updated to support changes to get_ele_cap().
get_ele_cap() now takes a char * argument to use for building the InstanceID. The
function needs to get the Name from the ref and pass that to get_ele_cap(). This bit of
code used to be in get_ele_cap() itself, but get_ele_cap() needs to be more generic.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 651039e9392c -r d9fa7a6eb180 src/Virt_ElementCapabilities.c
--- a/src/Virt_ElementCapabilities.c Tue Nov 27 13:31:58 2007 -0800
+++ b/src/Virt_ElementCapabilities.c Tue Nov 27 13:32:01 2007 -0800
@@ -133,10 +133,22 @@ static CMPIStatus cs_to_cap(const CMPIOb
{
CMPIInstance *inst;
CMPIStatus s = {CMPI_RC_OK, NULL};
-
- s = get_ele_cap(_BROKER, ref, &inst);
+ char *sys_name = NULL;
+
+ sys_name = cu_get_str_path(ref, "Name");
+ if (sys_name == NULL) {
+ CMSetStatusWithChars(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Missing key: Name");
+ goto out;
+ }
+
+ s = get_ele_cap(_BROKER, ref, sys_name, &inst);
if (s.rc == CMPI_RC_OK)
inst_list_add(list, inst);
+
+ out:
+ free(sys_name);
return s;
}