Commit 6500a6abe6 for qemu.org

commit 6500a6abe656743bab51cbff79a6b2c229cd688f
Author: Rohitashv Kumar <roohiit@amazon.de>
Date:   Fri Jul 17 08:18:34 2026 +0000

    tests/qtest/device-plug-test: skip pc tests when 'pc' machine is unavailable

    test_pci_unplug_request() and test_pci_unplug_json_request() use
    "-machine pc" on i386/x86_64. When QEMU is built without the i440fx/pc
    machine, these fail with "unsupported machine type 'pc'".

    Skip the x86 case when 'pc' is not available. Non-x86 architectures use
    the default machine and are unaffected, and x86 unplug coverage is still
    provided by the q35 variant (test_q35_pci_unplug_request), which already
    guards on qtest_has_machine("q35").

    Signed-off-by: Rohitashv Kumar <roohiit@amazon.de>
    Signed-off-by: Fabiano Rosas <farosas@suse.de>

diff --git a/tests/qtest/device-plug-test.c b/tests/qtest/device-plug-test.c
index 2707ee59f6..650956fa11 100644
--- a/tests/qtest/device-plug-test.c
+++ b/tests/qtest/device-plug-test.c
@@ -65,6 +65,10 @@ static void test_pci_unplug_request(void)
     }

     if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
+        if (!qtest_has_machine("pc")) {
+            g_test_skip("Machine 'pc' is not available");
+            return;
+        }
         machine_addition = "-machine pc";
     }

@@ -107,6 +111,10 @@ static void test_pci_unplug_json_request(void)
     }

     if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
+        if (!qtest_has_machine("pc")) {
+            g_test_skip("Machine 'pc' is not available");
+            return;
+        }
         machine_addition = "-machine pc";
     }