diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index d571cd38dc..5666e87f75 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -123,7 +123,7 @@ testQemuHotplugCheckResult(virDomainObj *vm, if (!actual) return -1; - if (STREQ(expected, actual)) { + if (STREQ_NULLABLE(expected, actual)) { if (fail) VIR_TEST_VERBOSE("domain XML should not match the expected result"); ret = 0; @@ -170,7 +170,9 @@ testQemuHotplug(const void *data) virTestLoadFile(device_filename, &device_xml) < 0) goto cleanup; - if (test->action == ATTACH && + if (!fail && + (test->action == ATTACH || + test->action == UPDATE) && virTestLoadFile(result_filename, &result_xml) < 0) goto cleanup; @@ -243,6 +245,9 @@ testQemuHotplug(const void *data) case UPDATE: ret = qemuDomainUpdateDeviceLive(vm, dev, &driver, false); + if (ret == 0 || fail) + ret = testQemuHotplugCheckResult(vm, result_xml, + result_filename, fail); } virObjectLock(priv->mon); diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-disk-cdrom+disk-cdrom-nochange.xml b/tests/qemuhotplugtestdomains/qemuhotplug-disk-cdrom+disk-cdrom-nochange.xml new file mode 120000 index 0000000000..e07b01b301 --- /dev/null +++ b/tests/qemuhotplugtestdomains/qemuhotplug-disk-cdrom+disk-cdrom-nochange.xml @@ -0,0 +1 @@ +qemuhotplug-disk-cdrom.xml \ No newline at end of file diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-disk-cdrom.xml b/tests/qemuhotplugtestdomains/qemuhotplug-disk-cdrom.xml index 3acf55ab17..bcf4cf9bf8 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-disk-cdrom.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-disk-cdrom.xml @@ -1,4 +1,4 @@ - + QEMUGuest1 c7a5fdbd-edaf-9455-926a-d65c16db1809 219100 @@ -8,6 +8,9 @@ hvm + + qemu64 + destroy restart @@ -18,6 +21,7 @@ +
@@ -25,13 +29,27 @@ +
- - - - - + + +
+ + + +
+ + + + + + + + + + +