[Libvirt-cim] [PATCH 2 of 3] ESD: adopt interface changes in VSSD

Heidi Eckhart heidieck at linux.vnet.ibm.com
Wed Feb 20 12:21:32 UTC 2008


# HG changeset patch
# User Heidi Eckhart <heidieck at linux.vnet.ibm.com>
# Date 1203508871 -3600
# Node ID 4a89baa025dfffc42cdd5f15c725b7b42fcb1212
# Parent  c77500943eae17131c7d0522a99d16b3e2f43489
ESD: adopt interface changes in VSSD
Signed-off-by: Heidi Eckhart <heidieck at linux.vnet.ibm.com>

diff -r c77500943eae -r 4a89baa025df src/Virt_ElementSettingData.c
--- a/src/Virt_ElementSettingData.c	Wed Feb 20 12:42:46 2008 +0100
+++ b/src/Virt_ElementSettingData.c	Wed Feb 20 13:01:11 2008 +0100
@@ -41,47 +41,20 @@ static CMPIStatus vssd_to_vssd(const CMP
 {
         CMPIStatus s = {CMPI_RC_OK, NULL};
         CMPIInstance *inst;
-        virConnectPtr conn = NULL;
-        virDomainPtr dom = NULL;
-        char *host = NULL;
-
+        
         if (!match_hypervisor_prefix(ref, info))
                 return s;
 
-        if (!parse_instanceid(ref, NULL, &host)) {
-                cu_statusf(_BROKER, &s,
-                           CMPI_RC_ERR_FAILED,
-                           "Unable to get system name");
-                goto out;
-        }
-
-        conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s);
-        if (conn == NULL)
-                goto out;
-
-        dom = virDomainLookupByName(conn, host);
-        if (dom == NULL) {
-                cu_statusf(_BROKER, &s,
-                           CMPI_RC_ERR_FAILED,
-                           "No such system `%s'", host);
-                goto out;
-        }
-
-        inst = get_vssd_instance(dom, _BROKER, ref);
-        if (inst == NULL) {
-                cu_statusf(_BROKER, &s,
-                           CMPI_RC_ERR_FAILED,
-                           "Error getting VSSD for `%s'", host);
-                goto out;
-        }
-
+        /* Special association case: 
+         * VSSD instance is pointing to itself
+         */
+        s = get_vssd_by_ref(_BROKER, ref, &inst);
+        if (s.rc != CMPI_RC_OK)
+                goto out;
+        
         inst_list_add(list, inst);
-
+        
  out:
-        virDomainFree(dom);
-        virConnectClose(conn);
-        free(host);
-
         return s;
 }
 




More information about the Libvirt-cim mailing list