# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1204150157 28800
# Node ID 534a933e0202dc425f3f27ba55dfa42e7c42db5f
# Parent 224ad7217cef6235bccb3377b9b86114ed61d6ae
Add TypesSupported[] to VirtualSystemManagementCapabilities
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r 224ad7217cef -r 534a933e0202 src/Virt_VirtualSystemManagementCapabilities.c
--- a/src/Virt_VirtualSystemManagementCapabilities.c Wed Feb 27 13:49:31 2008 -0800
+++ b/src/Virt_VirtualSystemManagementCapabilities.c Wed Feb 27 14:09:17 2008 -0800
@@ -46,11 +46,14 @@ enum {ADD_RESOURCES = 1,
static CMPIStatus set_inst_properties(const CMPIBroker *broker,
+ const CMPIObjectPath *ref,
CMPIInstance *inst)
{
CMPIStatus s = {CMPI_RC_OK, NULL};
CMPIArray *array;
uint16_t element;
+ char *prefix = NULL;
+ CMPIString *str;
CMSetProperty(inst, "InstanceID",
(CMPIValue *)"ManagementCapabilities", CMPI_chars);
@@ -73,7 +76,29 @@ static CMPIStatus set_inst_properties(co
CMSetProperty(inst, "SynchronousMethodsSupported",
(CMPIValue *)&array, CMPI_uint16A);
- out:
+
+ prefix = class_prefix_name(CLASSNAME(ref));
+ if (prefix == NULL) {
+ CU_DEBUG("Prefix of %s was NULL", CLASSNAME(ref));
+ goto out;
+ }
+
+ str = CMNewString(broker, prefix, &s);
+ if ((str == NULL) || (s.rc != CMPI_RC_OK))
+ goto out;
+
+ array = CMNewArray(broker, 1, CMPI_string, &s);
+ if ((s.rc != CMPI_RC_OK) || (CMIsNullObject(array)))
+ goto out;
+
+ CMSetArrayElementAt(array, 0, (CMPIValue *)&str, CMPI_string);
+
+ CMSetProperty(inst, "TypesSupported",
+ (CMPIValue *)&array, CMPI_charsA);
+
+ out:
+ free(prefix);
+
return s;
}
@@ -106,7 +131,7 @@ CMPIStatus get_vsm_cap(const CMPIBroker
goto out;
}
- s = set_inst_properties(broker, inst);
+ s = set_inst_properties(broker, ref, inst);
if (is_get_inst) {
s = cu_validate_ref(broker, ref, inst);
Show replies by date
Dan Smith wrote:
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1204150157 28800
# Node ID 534a933e0202dc425f3f27ba55dfa42e7c42db5f
# Parent 224ad7217cef6235bccb3377b9b86114ed61d6ae
Add TypesSupported[] to VirtualSystemManagementCapabilities
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r 224ad7217cef -r 534a933e0202 src/Virt_VirtualSystemManagementCapabilities.c
+
+ CMSetProperty(inst, "TypesSupported",
+ (CMPIValue *)&array, CMPI_charsA);
+
I think this should be CMPI_stringA, but otherwise this patch is good.
--
Kaitlin Rupert
IBM Linux Technology Center
kaitlin(a)linux.vnet.ibm.com
KR> I think this should be CMPI_stringA, but otherwise this patch is
KR> good.
The CIMOM doesn't seem to care because it converts them all to
CMPIString objects anyway, but yes, this should be stringA.
I initially had tried adding a CMPI_chars to the array, but I was
getting a crash. Creating a CMPIString and changing the type of the
array seemed to make it happy, but I forgot to change the type of the
property :)
I'll resend. Thanks!
--
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms(a)us.ibm.com