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

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


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

diff -r 330455bd7468 -r 9e52e86e0765 src/Virt_ElementSettingData.c
--- a/src/Virt_ElementSettingData.c	Tue Feb 26 09:51:45 2008 +0100
+++ b/src/Virt_ElementSettingData.c	Tue Feb 26 09:55:42 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");
+        /* 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;
-        }
-
-        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;
-        }
 
         inst_list_add(list, inst);
 
  out:
-        virDomainFree(dom);
-        virConnectClose(conn);
-        free(host);
-
         return s;
 }
 




More information about the Libvirt-cim mailing list