From: Michal Privoznik Date: Thu, 26 Feb 2026 10:01:54 +0000 (+0100) Subject: qemuhotplugtest: Introduce interface-hostdev test case X-Git-Tag: v12.2.0-rc1~95 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f9bb819fc4841dbdff801629bf58f9fd6d7d93eb;p=thirdparty%2Flibvirt.git qemuhotplugtest: Introduce interface-hostdev test case While our qemuhotplugtest already does a PCI hotplug and unlpug ("hostdev-pci") there is another way to hotplug a PCI device, esp. if it's a NIC: . This has been missing and as shown in v12.1.0-rc1-4-gfe782ed334 can be potentially dangerous as some different paths are taken. Introduce a test case for interface-hostdev. Signed-off-by: Michal Privoznik Reviewed-by: Laine Stump --- diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 0cd738ae3d..6cb616c59b 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -697,6 +697,10 @@ mymain(void) DO_TEST_DETACH("ppc64", "pseries-base-live", "hostdev-pci", false, false, "device_del", QMP_DEVICE_DELETED("hostdev0") QMP_OK); + DO_TEST_ATTACH("x86_64", "base-live", "interface-hostdev", false, true, + "device_add", QMP_OK); + DO_TEST_DETACH("x86_64", "base-live", "interface-hostdev", false, false, + "device_del", QMP_DEVICE_DELETED("hostdev0") QMP_OK); DO_TEST_ATTACH("x86_64", "base-live", "interface-vdpa", false, true, "query-fdsets", "{\"return\":[{\"fdset-id\":99999}]}", "add-fd", "{ \"return\": { \"fdset-id\": 1, \"fd\": 95 }}", @@ -802,4 +806,5 @@ VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("virpci"), VIR_TEST_MOCK("domaincaps"), VIR_TEST_MOCK("virprocess"), - VIR_TEST_MOCK("qemuhotplug")); + VIR_TEST_MOCK("qemuhotplug"), + VIR_TEST_MOCK("virnetdev")); diff --git a/tests/qemuhotplugtestdevices/qemuhotplug-interface-hostdev.xml b/tests/qemuhotplugtestdevices/qemuhotplug-interface-hostdev.xml new file mode 100644 index 0000000000..0eb7a1df1a --- /dev/null +++ b/tests/qemuhotplugtestdevices/qemuhotplug-interface-hostdev.xml @@ -0,0 +1,6 @@ + + +
+ + + diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-live+interface-hostdev.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-live+interface-hostdev.xml new file mode 100644 index 0000000000..13288f7711 --- /dev/null +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-live+interface-hostdev.xml @@ -0,0 +1,63 @@ + + hotplug + d091ea82-29e6-2e34-3005-f02617b36e87 + 4194304 + 4194304 + 4 + + hvm + + + + + + + + + qemu64 + + + destroy + restart + restart + + /usr/bin/qemu-system-x86_64 + + +
+ + + +
+ + + +
+ + + + + + +
+ + + + + +
+ + +
+ + + + + + + +