[Libvirt-cim] [PATCH 4 of 4] Use get_host_system_properties() in VSMgmtService to get attributes

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Mon Dec 17 18:25:23 UTC 2007


# HG changeset patch
# User Kaitlin Rupert <karupert at us.ibm.com>
# Date 1197915820 28800
# Node ID d6cf74b64c720d65da17bdac2604f7d0f1d31f7e
# Parent  cec8c353e72fe13f9485afcd73afa7f4c4e76776
Use get_host_system_properties() in VSMgmtService to get attributes.

Use get_host_system_properties() to get the host attributes.

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

diff -r cec8c353e72f -r d6cf74b64c72 src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c	Fri Dec 14 17:25:10 2007 -0800
+++ b/src/Virt_VirtualSystemManagementService.c	Mon Dec 17 10:23:40 2007 -0800
@@ -1125,8 +1125,8 @@ CMPIStatus get_vsms(const CMPIObjectPath
 { 
         CMPIStatus s = {CMPI_RC_OK, NULL};
         CMPIInstance *inst = NULL;
-        CMPIInstance *host = NULL;
-        const char *val = NULL;
+        const char *name = NULL;
+        const char *ccname = NULL;
         virConnectPtr conn = NULL;
 
         *_inst = NULL;
@@ -1134,10 +1134,6 @@ CMPIStatus get_vsms(const CMPIObjectPath
         if (conn == NULL)
                 return s;
 
-        s = get_host_cs(broker, reference, &host);
-        if (s.rc != CMPI_RC_OK)
-                goto out;
-
         inst = get_typed_instance(broker,
                                   pfx_from_conn(conn),
                                   "VirtualSystemManagementService",
@@ -1151,28 +1147,25 @@ CMPIStatus get_vsms(const CMPIObjectPath
                 goto out;
         }
 
+        s = get_host_system_properties(&name, 
+                                       &ccname, 
+                                       reference,
+                                       broker);
+        if (s.rc != CMPI_RC_OK) {
+                cu_statusf(broker, &s,
+                           CMPI_RC_ERR_FAILED,
+                           "Unable to get host attributes");
+                goto out;
+        }
+
         CMSetProperty(inst, "Name",
                       (CMPIValue *)"Management Service", CMPI_chars);
 
-        if (cu_get_str_prop(host, "Name", &val) != CMPI_RC_OK) {
-                cu_statusf(broker, &s,
-                           CMPI_RC_ERR_FAILED,
-                           "Unable to get name of HostSystem");
-                goto out;
-        }
-
         CMSetProperty(inst, "SystemName",
-                      (CMPIValue *)val, CMPI_chars);
-
-        if (cu_get_str_prop(host, "CreationClassName", &val) != CMPI_RC_OK) {
-                cu_statusf(broker, &s,
-                           CMPI_RC_ERR_FAILED,
-                           "Unable to get creation class of HostSystem");
-                goto out;
-        }
+                      (CMPIValue *)name, CMPI_chars);
 
         CMSetProperty(inst, "SystemCreationClassName",
-                      (CMPIValue *)val, CMPI_chars);
+                      (CMPIValue *)ccname, CMPI_chars);
 
         CMSetStatus(&s, CMPI_RC_OK);
 




More information about the Libvirt-cim mailing list