[Libvirt-cim] [PATCH 3 of 6] VSMS: adopt ComputerSystem interface changes

Heidi Eckhart heidieck at linux.vnet.ibm.com
Mon Mar 3 10:51:28 UTC 2008


# HG changeset patch
# User Heidi Eckhart <heidieck at linux.vnet.ibm.com>
# Date 1204541459 -3600
# Node ID f6c14b91e8da58e79221b9e7ccb652419dffcc23
# Parent  15e12adf6218a512063fe87b836b87e8e3aed569
VSMS: adopt ComputerSystem interface changes

Adopt the interface changes of ComputerSystem to connect_and_create().
Also added missing virDomainFree().

Signed-off-by: Heidi Eckhart <heidieck at linux.vnet.ibm.com>

diff -r 15e12adf6218 -r f6c14b91e8da src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c	Mon Mar 03 11:50:58 2008 +0100
+++ b/src/Virt_VirtualSystemManagementService.c	Mon Mar 03 11:50:59 2008 +0100
@@ -331,7 +331,7 @@ static CMPIInstance *connect_and_create(
         virConnectPtr conn;
         virDomainPtr dom;
         const char *name;
-        CMPIInstance *inst;
+        CMPIInstance *inst = NULL;
 
         conn = connect_by_classname(_BROKER, CLASSNAME(ref), s);
         if (conn == NULL) {
@@ -349,14 +349,16 @@ static CMPIInstance *connect_and_create(
         }
 
         name = virDomainGetName(dom);
-        inst = instance_from_name(_BROKER, conn, (char *)name, ref);
-        if (inst == NULL) {
+
+        *s = get_domain_by_name(_BROKER, ref, name, &inst);
+        if (s->rc != CMPI_RC_OK) {
                 CU_DEBUG("Failed to get new instance");
                 cu_statusf(_BROKER, s,
                            CMPI_RC_ERR_FAILED,
                            "Failed to lookup resulting system");
         }
 
+        virDomainFree(dom);
         virConnectClose(conn);
 
         return inst;




More information about the Libvirt-cim mailing list