mirror of
https://github.com/libvirt/libvirt.git
synced 2026-08-13 06:34:42 -05:00
tests: qemuhotplug: Fix segfault when XML loading fails
Some tests use the same VM state multiple times in a row. But if we failed loading the VM XML, subsequent tests crash on the NULL def pointer Acked-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
@@ -268,6 +268,10 @@ testQemuHotplug(const void *data)
|
|||||||
|
|
||||||
if (test->vm) {
|
if (test->vm) {
|
||||||
vm = test->vm;
|
vm = test->vm;
|
||||||
|
if (!vm->def) {
|
||||||
|
VIR_TEST_VERBOSE("test skipped due to failure of dependent test\n");
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (qemuHotplugCreateObjects(driver.xmlopt, &vm, domain_xml,
|
if (qemuHotplugCreateObjects(driver.xmlopt, &vm, domain_xml,
|
||||||
test->deviceDeletedEvent) < 0)
|
test->deviceDeletedEvent) < 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user