[PATCH] VSMC returns extra instances - add connect_by_classname

# HG changeset patch # User Kaitlin Rupert <karupert@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@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; }

Kaitlin Rupert wrote:
# HG changeset patch # User Kaitlin Rupert <karupert@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@us.ibm.com>
Heidi, I'm not sure this will solve the problem where wbemein http://localhost/root/virt:CIM_EnabledLogicalElementCapabilities returns incorrect / invalid instances. I think I hit a race condition today that caused connect_by_classname(KVM_<>) to pass even though libvirtd wasn't even running on my test system. -- Kaitlin Rupert IBM Linux Technology Center karupert@us.ibm.com

Kaitlin Rupert wrote:
Kaitlin Rupert wrote:
# HG changeset patch # User Kaitlin Rupert <karupert@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@us.ibm.com>
Heidi, I'm not sure this will solve the problem where wbemein http://localhost/root/virt:CIM_EnabledLogicalElementCapabilities returns incorrect / invalid instances. I think I hit a race condition today that caused connect_by_classname(KVM_<>) to pass even though libvirtd wasn't even running on my test system. That sounds strange. Are you sure, that no libvirt was somehow reachable ? Is in theory an instance of KVM_ valid on your test system, or not ?
I was able to successfully test the patch set against Pegasus and sfcb ... +1 for the complete patch set -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck@linux.vnet.ibm.com ************************************************** IBM Deutschland Entwicklung GmbH Vorsitzender des Aufsichtsrats: Martin Jetter Geschaeftsfuehrung: Herbert Kircher Sitz der Gesellschaft: Boeblingen Registergericht: Amtsgericht Stuttgart, HRB 243294
participants (2)
-
Heidi Eckhart
-
Kaitlin Rupert