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

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


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

diff -r 51a9cb4ae264 -r 014d278b320a src/Virt_ElementSettingData.c
--- a/src/Virt_ElementSettingData.c	Mon Feb 25 11:09:43 2008 +0100
+++ b/src/Virt_ElementSettingData.c	Mon Feb 25 11:09:45 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