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>
Rohitashv Kumar committed
Jul 17, 2026 at 08:18 UTC
4e37f749ddf4717b4f9df786232584f8a7953cb8
1 file changed
+16
tests/qtest/drive_del-test.c
+16
@@ -258,6 +258,10 @@ static void test_cli_device_del(void)
258
}
259
260
if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
261
+ if (!qtest_has_machine("pc")) {
262
+ g_test_skip("Machine 'pc' is not available");
263
+ return;
264
+ }
265
machine_addition = "-machine pc";
266
}
267
@@ -332,6 +336,10 @@ static void test_device_add_and_del(void)
336
}
337
338
if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
339
+ if (!qtest_has_machine("pc")) {
340
+ g_test_skip("Machine 'pc' is not available");
341
+ return;
342
+ }
343
machine_addition = "-machine pc";
344
}
345
@@ -403,6 +411,10 @@ static void test_drive_add_device_add_and_del(void)
411
}
412
413
if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
414
+ if (!qtest_has_machine("pc")) {
415
+ g_test_skip("Machine 'pc' is not available");
416
+ return;
417
+ }
418
machine_addition = "-machine pc";
419
}
420
@@ -456,6 +468,10 @@ static void test_blockdev_add_device_add_and_del(void)
468
}
469
470
if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
471
+ if (!qtest_has_machine("pc")) {
472
+ g_test_skip("Machine 'pc' is not available");
473
+ return;
474
+ }
475
machine_addition = "-machine pc";
476
}
477