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

Sharad Mishra snmishra at us.ibm.com
Fri Jun 26 23:05:33 UTC 2009


+1

Sharad Mishra
System x Enablement
Linux Technology Center
IBM


                                                                           
             Kaitlin Rupert                                                
             <kaitlin at linux.vn                                             
             et.ibm.com>                                                To 
             Sent by:                  libvirt-cim at redhat.com              
             libvirt-cim-bounc                                          cc 
             es at redhat.com                                                 
                                                                   Subject 
                                       [Libvirt-cim] [PATCH] Set the       
             06/24/2009 10:27          OperationalStatus attribute of      
             AM                        VirtualSystemManagementService      
                                                                           
                                                                           
             Please respond to                                             
                 List for                                                  
              discussion and                                               
              development of                                               
                libvirt CIM                                                
             <libvirt-cim at redh                                             
                  at.com>                                                  
                                                                           
                                                                           




# 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

_______________________________________________
Libvirt-cim mailing list
Libvirt-cim at redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-cim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20090626/85572c5a/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20090626/85572c5a/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic27140.gif
Type: image/gif
Size: 1255 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20090626/85572c5a/attachment-0001.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ecblank.gif
Type: image/gif
Size: 45 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20090626/85572c5a/attachment-0002.gif>


More information about the Libvirt-cim mailing list