mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00: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:
parent
8e2982b576
commit
f14f0836c5
@ -268,6 +268,10 @@ testQemuHotplug(const void *data)
|
||||
|
||||
if (test->vm) {
|
||||
vm = test->vm;
|
||||
if (!vm->def) {
|
||||
VIR_TEST_VERBOSE("test skipped due to failure of dependent test\n");
|
||||
goto cleanup;
|
||||
}
|
||||
} else {
|
||||
if (qemuHotplugCreateObjects(driver.xmlopt, &vm, domain_xml,
|
||||
test->deviceDeletedEvent) < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user