[Libvirt-cim] [PATCH 3 of 4] SDS: adopt interface changes in VSSD

Heidi Eckhart heidieck at linux.vnet.ibm.com
Tue Feb 26 09:10:19 UTC 2008


# HG changeset patch
# User Heidi Eckhart <heidieck at linux.vnet.ibm.com>
# Date 1204016311 -3600
# Node ID 972e31994c47cfbd4af63b83c1138bc83e6d2b23
# Parent  9e52e86e0765b889e7755c5c5c885342d644ed2c
SDS: adopt interface changes in VSSD
Signed-off-by: Heidi Eckhart <heidieck at linux.vnet.ibm.com>

diff -r 9e52e86e0765 -r 972e31994c47 src/Virt_SettingsDefineState.c
--- a/src/Virt_SettingsDefineState.c	Tue Feb 26 09:55:42 2008 +0100
+++ b/src/Virt_SettingsDefineState.c	Tue Feb 26 09:58:31 2008 +0100
@@ -199,18 +199,16 @@ static CMPIStatus vs_to_vssd(const CMPIO
                              struct std_assoc_info *info,
                              struct inst_list *list)
 {
-        virConnectPtr conn = NULL;
-        virDomainPtr dom = NULL;
+        CMPIStatus s = {CMPI_RC_OK, NULL};
+        CMPIInstance *inst;
         const char *name;
-        CMPIInstance *vssd;
-        CMPIStatus s = {CMPI_RC_OK, NULL};
 
         if (!match_hypervisor_prefix(ref, info))
                 return s;
 
-        conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s);
-        if (conn == NULL)
-                return s;
+        s = get_domain(_BROKER, ref, &inst);
+        if (s.rc != CMPI_RC_OK)
+                goto out;
 
         if (cu_get_str_path(ref, "Name", &name) != CMPI_RC_OK) {
                 cu_statusf(_BROKER, &s,
@@ -219,27 +217,14 @@ static CMPIStatus vs_to_vssd(const CMPIO
                 goto out;
         }
 
-        dom = virDomainLookupByName(conn, name);
-        if (dom == NULL) {
-                cu_statusf(_BROKER, &s,
-                           CMPI_RC_ERR_FAILED,
-                           "No such domain `%s'", name);
-                goto out;
-        }
-
-        vssd = get_vssd_instance(dom, _BROKER, ref);
-        if (vssd != NULL)
-                inst_list_add(list, vssd);
-
-        cu_statusf(_BROKER, &s,
-                   CMPI_RC_OK,
-                   "");
- out:
-        virDomainFree(dom);
-        virConnectClose(conn);
-
+        s = get_vssd_by_name(_BROKER, ref, name, &inst);
+        if (s.rc != CMPI_RC_OK)
+                goto out;
+
+        inst_list_add(list, inst);
+        
+ out:
         return s;
-
 }
 
 static CMPIStatus vssd_to_vs(const CMPIObjectPath *ref,
@@ -253,9 +238,14 @@ static CMPIStatus vssd_to_vs(const CMPIO
         virConnectPtr conn = NULL;
         CMPIStatus s = {CMPI_RC_OK, NULL};
         CMPIInstance *cs;
+        CMPIInstance *inst;
 
         if (!match_hypervisor_prefix(ref, info))
                 return s;
+
+        s = get_vssd_by_ref(_BROKER, ref, &inst);
+        if (s.rc != CMPI_RC_OK)
+                goto out;
 
         if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) {
                 cu_statusf(_BROKER, &s,




More information about the Libvirt-cim mailing list