# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1193407878 25200
# Node ID 1fef15850ba5557cc421206fb3ff569f6845ad99
# Parent c0f41fb8b46631e3a636e28beb50be22a7929a1e
Make VSMS an instance provider
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r c0f41fb8b466 -r 1fef15850ba5 schema/VirtualSystemManagementService.registration
--- a/schema/VirtualSystemManagementService.registration Fri Oct 26 07:05:10 2007 -0700
+++ b/schema/VirtualSystemManagementService.registration Fri Oct 26 07:11:18 2007 -0700
@@ -1,3 +1,3 @@
# Copyright IBM Corp. 2007
-Xen_VirtualSystemManagementService root/ibmsd Virt_VirtualSystemManagementService
Virt_VirtualSystemManagementService method
-KVM_VirtualSystemManagementService root/ibmsd Virt_VirtualSystemManagementService
Virt_VirtualSystemManagementService method
+Xen_VirtualSystemManagementService root/ibmsd Virt_VirtualSystemManagementService
Virt_VirtualSystemManagementService method instance
+KVM_VirtualSystemManagementService root/ibmsd Virt_VirtualSystemManagementService
Virt_VirtualSystemManagementService method instance
diff -r c0f41fb8b466 -r 1fef15850ba5 src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Fri Oct 26 07:05:10 2007 -0700
+++ b/src/Virt_VirtualSystemManagementService.c Fri Oct 26 07:11:18 2007 -0700
@@ -896,6 +896,80 @@ STDIM_MethodMIStub(, Virt_VirtualSystemM
STDIM_MethodMIStub(, Virt_VirtualSystemManagementService,
_BROKER, CMNoHook, my_handlers);
+
+static CMPIStatus return_vsms(const CMPIObjectPath *reference,
+ const CMPIResult *results,
+ int name_only)
+{
+ CMPIStatus s;
+ CMPIInstance *inst;
+
+ inst = get_typed_instance(_BROKER,
+ "VirtualSystemManagementService",
+ NAMESPACE(reference));
+ if (inst == NULL) {
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Failed to create instance");
+ goto out;
+ }
+
+ CMSetProperty(inst, "Name",
+ (CMPIValue *)"Management Service", CMPI_chars);
+
+ if (name_only)
+ cu_return_instance_name(results, inst);
+ else
+ CMReturnInstance(results, inst);
+
+ CMSetStatus(&s, CMPI_RC_OK);
+
+ out:
+ return s;
+}
+
+static CMPIStatus EnumInstanceNames(CMPIInstanceMI *self,
+ const CMPIContext *context,
+ const CMPIResult *results,
+ const CMPIObjectPath *reference)
+{
+ return return_vsms(reference, results, 1);
+}
+
+static CMPIStatus EnumInstances(CMPIInstanceMI *self,
+ const CMPIContext *context,
+ const CMPIResult *results,
+ const CMPIObjectPath *reference,
+ const char **properties)
+{
+
+ return return_vsms(reference, results, 0);
+}
+
+static CMPIStatus GetInstance(CMPIInstanceMI *self,
+ const CMPIContext *context,
+ const CMPIResult *results,
+ const CMPIObjectPath *reference,
+ const char **properties)
+{
+ return return_vsms(reference, results, 0);
+}
+
+DEFAULT_CI();
+DEFAULT_MI();
+DEFAULT_DI();
+DEFAULT_EQ();
+DEFAULT_INST_CLEANUP();
+
+/* Avoid a warning in the stub macro below */
+CMPIInstanceMI *
+Virt_VirtualSystemManagementService_Create_InstanceMI(const CMPIBroker *,
+ const CMPIContext *,
+ CMPIStatus *rc);
+
+CMInstanceMIStub(, Virt_VirtualSystemManagementService, _BROKER, CMNoHook);
+
+
/*
* Local Variables:
* mode: C