[Libvirt-cim] [PATCH] Set the OperationalStatus attribute of VirtualSystemManagementService

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Wed Jun 24 17:27:27 UTC 2009


# HG changeset patch
# User Kaitlin Rupert <karupert at us.ibm.com>
# Date 1245864436 25200
# Node ID f1f435da7db3230365969a7abdbeeff9ef154676
# Parent  7417f62e29eb8b37acb66e616e49f51901f610c6
Set the OperationalStatus attribute of VirtualSystemManagementService

As long as the providers are installed properly, the
VirtualSystemManagementService should always be available.  So we just need
to statically set the value as 'OK'.

Signed-off-by: Kaitlin Rupert <karupert at us.ibm.com>

diff -r 7417f62e29eb -r f1f435da7db3 src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c	Wed Jun 24 10:12:22 2009 -0700
+++ b/src/Virt_VirtualSystemManagementService.c	Wed Jun 24 10:27:16 2009 -0700
@@ -2273,6 +2273,8 @@
         unsigned long hv_version = 0;
         const char * hv_type = NULL;
         char *caption = NULL;
+        CMPIArray *array;
+        uint16_t op_status;
 
         *_inst = NULL;
         conn = connect_by_classname(broker, CLASSNAME(reference), &s);
@@ -2352,6 +2354,16 @@
         CMSetProperty(inst, "Release",
                       (CMPIValue *)PACKAGE_VERSION, CMPI_chars);
 
+        array = CMNewArray(broker, 1, CMPI_uint16, &s);
+        if ((s.rc != CMPI_RC_OK) || (CMIsNullObject(array)))
+                goto out;
+
+        op_status = CIM_OPERATIONAL_STATUS;
+        CMSetArrayElementAt(array, 0, &op_status, CMPI_uint16);
+
+        CMSetProperty(inst, "OperationalStatus",
+                      (CMPIValue *)&array, CMPI_uint16A);
+
         if (is_get_inst) {
                 s = cu_validate_ref(broker, reference, inst);
                 if (s.rc != CMPI_RC_OK)
diff -r 7417f62e29eb -r f1f435da7db3 src/svpc_types.h
--- a/src/svpc_types.h	Wed Jun 24 10:12:22 2009 -0700
+++ b/src/svpc_types.h	Wed Jun 24 10:27:16 2009 -0700
@@ -22,6 +22,8 @@
 #ifndef __SVPC_TYPES_H
 #define __SVPC_TYPES_H
 
+#define CIM_OPERATIONAL_STATUS 2
+
 #define CIM_RES_TYPE_ALL        0
 #define CIM_RES_TYPE_PROC       3
 #define CIM_RES_TYPE_MEM        4




More information about the Libvirt-cim mailing list