[PATCH] ComputerSystem: getInstance with wrong hypervisor segfaults

# HG changeset patch # User Heidi Eckhart <heidieck@linux.vnet.ibm.com> # Date 1201179188 -3600 # Node ID 2a4ee3b11a8e2879597b6e312eaa8ccdd1e56aef # Parent dc5a3cf2e717e2630958454211bc7e0e4b8b2e94 ComputerSystem: getInstance with wrong hypervisor segfaults wbemgi 'http://localhost:5988/root/virt:Xen_ComputerSystem.CreationClassName="KVM_ComputerSystem",Name="qemu1"' on a KVM system seg faults. Signed-off-by: Heidi Eckhart <heidieck@linux.vnet.ibm.com> diff -r dc5a3cf2e717 -r 2a4ee3b11a8e src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Thu Jan 24 13:28:14 2008 +0100 +++ b/src/Virt_ComputerSystem.c Thu Jan 24 13:53:08 2008 +0100 @@ -394,8 +394,12 @@ CMPIStatus get_domain(const CMPIBroker * } conn = connect_by_classname(broker, CLASSNAME(reference), &s); - if (conn == NULL) + if (conn == NULL) { + cu_statusf(broker, &s, + CMPI_RC_ERR_NOT_FOUND, + "No such instance."); return s; + } _inst = instance_from_name(broker, conn, name, reference); if (_inst == NULL) {

Heidi Eckhart wrote:
# HG changeset patch # User Heidi Eckhart <heidieck@linux.vnet.ibm.com> # Date 1201179188 -3600 # Node ID 2a4ee3b11a8e2879597b6e312eaa8ccdd1e56aef # Parent dc5a3cf2e717e2630958454211bc7e0e4b8b2e94 ComputerSystem: getInstance with wrong hypervisor segfaults
wbemgi 'http://localhost:5988/root/virt:Xen_ComputerSystem.CreationClassName="KVM_ComputerSystem",Name="qemu1"' on a KVM system seg faults. Signed-off-by: Heidi Eckhart <heidieck@linux.vnet.ibm.com>
diff -r dc5a3cf2e717 -r 2a4ee3b11a8e src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Thu Jan 24 13:28:14 2008 +0100 +++ b/src/Virt_ComputerSystem.c Thu Jan 24 13:53:08 2008 +0100 @@ -394,8 +394,12 @@ CMPIStatus get_domain(const CMPIBroker * }
conn = connect_by_classname(broker, CLASSNAME(reference), &s); - if (conn == NULL) + if (conn == NULL) { + cu_statusf(broker, &s, + CMPI_RC_ERR_NOT_FOUND, + "No such instance."); return s; + }
_inst = instance_from_name(broker, conn, name, reference); if (_inst == NULL) {
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim
Hmm, second patch in a row that I've looked at that was just like this. Do you know if this is a widespread issue or not? -- -Jay

Jay Gagnon wrote:
Hmm, second patch in a row that I've looked at that was just like this. Do you know if this is a widespread issue or not?
Maybe. I'm testing step by step through all classes and fix it immediately, where I find an issue. -- Regards Heidi Eckhart Software Engineer IBM Linux Technology Center - Open Hypervisor

Heidi Eckhart wrote:
# HG changeset patch # User Heidi Eckhart <heidieck@linux.vnet.ibm.com> # Date 1201179188 -3600 # Node ID 2a4ee3b11a8e2879597b6e312eaa8ccdd1e56aef # Parent dc5a3cf2e717e2630958454211bc7e0e4b8b2e94 ComputerSystem: getInstance with wrong hypervisor segfaults
wbemgi 'http://localhost:5988/root/virt:Xen_ComputerSystem.CreationClassName="KVM_ComputerSystem",Name="qemu1"' on a KVM system seg faults. Signed-off-by: Heidi Eckhart <heidieck@linux.vnet.ibm.com>
Dan, please can you check in this tiny patch ? Thanks. -- Regards Heidi Eckhart Software Engineer IBM Linux Technology Center - Open Hypervisor

HE> Dan, please can you check in this tiny patch ? Thanks. Sorry! I got it now. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@us.ibm.com
participants (3)
-
Dan Smith
-
Heidi Eckhart
-
Jay Gagnon