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

Heidi Eckhart heidieck at linux.vnet.ibm.com
Mon Feb 25 10:23:15 UTC 2008


# HG changeset patch
# User Heidi Eckhart <heidieck at linux.vnet.ibm.com>
# Date 1203934186 -3600
# Node ID 974c0863140b29682d450b8f9e0edec8052e1bae
# Parent  014d278b320ab85bd3172b569df0a4485809b9cb
SDS: adopt interface changes in VSSD
Signed-off-by: Heidi Eckhart <heidieck at linux.vnet.ibm.com>

diff -r 014d278b320a -r 974c0863140b src/Virt_SettingsDefineState.c
--- a/src/Virt_SettingsDefineState.c	Mon Feb 25 11:09:45 2008 +0100
+++ b/src/Virt_SettingsDefineState.c	Mon Feb 25 11:09:46 2008 +0100
@@ -196,18 +196,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,
@@ -215,28 +213,15 @@ static CMPIStatus vs_to_vssd(const CMPIO
                            "Missing Name property");
                 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,
@@ -250,9 +235,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