# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1196459465 28800
# Node ID 801398c33b0a6486b096dc415c3d4aba47d9dc04
# Parent 58b71ad05a128ceca9777e9bdc0e439bf51ad322
Make VirtualSystemManagementCapabilities not use a devid-style InstanceID
This changes to a static InstanceID (since this is a singleton) and remove
all the sys_name plumbing.
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r 58b71ad05a12 -r 801398c33b0a src/Virt_VirtualSystemManagementCapabilities.c
--- a/src/Virt_VirtualSystemManagementCapabilities.c Fri Nov 30 10:43:37 2007 -0800
+++ b/src/Virt_VirtualSystemManagementCapabilities.c Fri Nov 30 13:51:05 2007 -0800
@@ -30,7 +30,6 @@
#include "std_instance.h"
#include "misc_util.h"
-#include "device_parsing.h"
#include "Virt_VirtualSystemManagementCapabilities.h"
#include "Virt_HostSystem.h"
@@ -48,24 +47,17 @@ enum {ADD_RESOURCES = 1,
static CMPIStatus set_inst_properties(const CMPIBroker *broker,
CMPIInstance *inst,
- const char *classname,
- const char *sys_name)
+ const char *classname)
{
CMPIStatus s = {CMPI_RC_OK, NULL};
CMPIArray *array;
uint16_t element;
- char *devid;
-
+
CMSetProperty(inst, "CreationClassName",
(CMPIValue *)classname, CMPI_chars);
- devid = get_fq_devid((char *)sys_name, "0");
- if (devid == NULL) {
- CMSetStatusWithChars(broker, &s, CMPI_RC_ERR_FAILED,
- "Could not get full ID.");
- goto out;
- }
- CMSetProperty(inst, "InstanceID", (CMPIValue *)devid, CMPI_chars);
+ CMSetProperty(inst, "InstanceID",
+ (CMPIValue *)"ManagementCapabilities", CMPI_chars);
array = CMNewArray(broker, 4, CMPI_uint16, &s);
if ((s.rc != CMPI_RC_OK) || CMIsNullObject(array))
@@ -91,7 +83,6 @@ static CMPIStatus set_inst_properties(co
CMPIStatus get_vsm_cap(const CMPIBroker *broker,
const CMPIObjectPath *ref,
- const char* sys_name,
CMPIInstance **inst)
{
CMPIStatus s;
@@ -123,7 +114,7 @@ CMPIStatus get_vsm_cap(const CMPIBroker
goto out;
}
- s = set_inst_properties(broker, *inst, classname, sys_name);
+ s = set_inst_properties(broker, *inst, classname);
out:
free(classname);
@@ -137,16 +128,8 @@ static CMPIStatus return_vsm_cap(const C
{
CMPIStatus s = {CMPI_RC_OK, NULL};
CMPIInstance *inst = NULL;
- const char *hostname = NULL;
- s = get_host_cs(_BROKER, ref, &inst);
- if (s.rc != CMPI_RC_OK)
- goto out;
-
- if (cu_get_str_prop(inst, "Name", &hostname) != CMPI_RC_OK)
- goto out;
-
- s = get_vsm_cap(_BROKER, ref, hostname, &inst);
+ s = get_vsm_cap(_BROKER, ref, &inst);
if (s.rc != CMPI_RC_OK)
goto out;
diff -r 58b71ad05a12 -r 801398c33b0a src/Virt_VirtualSystemManagementCapabilities.h
--- a/src/Virt_VirtualSystemManagementCapabilities.h Fri Nov 30 10:43:37 2007 -0800
+++ b/src/Virt_VirtualSystemManagementCapabilities.h Fri Nov 30 13:51:05 2007 -0800
@@ -20,7 +20,6 @@
*/
CMPIStatus get_vsm_cap(const CMPIBroker *broker,
const CMPIObjectPath *ref,
- const char* sys_name,
CMPIInstance **inst);
/*
* Local Variables: