Commit 4e37f749dd for qemu.org

commit 4e37f749ddf4717b4f9df786232584f8a7953cb8
Author: Rohitashv Kumar <roohiit@amazon.de>
Date:   Fri Jul 17 08:18:35 2026 +0000

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

    test_cli_device_del(), test_device_add_and_del(),
    test_drive_add_device_add_and_del() and
    test_blockdev_add_device_add_and_del() 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 the corresponding _q35
    variants already cover x86 under 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/drive_del-test.c b/tests/qtest/drive_del-test.c
index 30d9451ddd..4c32da594a 100644
--- a/tests/qtest/drive_del-test.c
+++ b/tests/qtest/drive_del-test.c
@@ -258,6 +258,10 @@ static void test_cli_device_del(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";
     }

@@ -332,6 +336,10 @@ static void test_device_add_and_del(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";
     }

@@ -403,6 +411,10 @@ static void test_drive_add_device_add_and_del(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";
     }

@@ -456,6 +468,10 @@ static void test_blockdev_add_device_add_and_del(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";
     }