# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1196809769 28800
# Node ID f83fe9e0ad3648502dcc52eabdb8ebc2c6baf046
# Parent e9e11611dc975a72237a9653b0a4a07ab9b4b4e1
VSMC returns extra instances - add connect_by_classname.
VSMC is returning an instance for both KVM and Xen, when only a Xen instance should be
returned.
Test query:
wbemcli ein
http://localhost/root/virt:CIM_VirtualSystemManagementCapabilities
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r e9e11611dc97 -r f83fe9e0ad36 src/Virt_VirtualSystemManagementCapabilities.c
--- a/src/Virt_VirtualSystemManagementCapabilities.c Tue Dec 04 09:10:36 2007 -0800
+++ b/src/Virt_VirtualSystemManagementCapabilities.c Tue Dec 04 15:09:29 2007 -0800
@@ -128,6 +128,11 @@ static CMPIStatus return_vsm_cap(const C
{
CMPIStatus s = {CMPI_RC_OK, NULL};
CMPIInstance *inst = NULL;
+ virConnectPtr conn = NULL;
+
+ conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s);
+ if (conn == NULL)
+ goto out;
s = get_vsm_cap(_BROKER, ref, &inst);
if (s.rc != CMPI_RC_OK)
@@ -138,6 +143,8 @@ static CMPIStatus return_vsm_cap(const C
else
CMReturnInstance(results, inst);
out:
+ virConnectClose(conn);
+
return s;
}