All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] tests/qtest: make PCI tests resilient to a compiled-out i440fx/pc machine
@ 2026-07-17  8:18 Rohitashv Kumar
  2026-07-17  8:18 ` [PATCH 1/3] tests/qtest/device-plug-test: skip pc tests when 'pc' machine is unavailable Rohitashv Kumar
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Rohitashv Kumar @ 2026-07-17  8:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Fabiano Rosas, Laurent Vivier, Paolo Bonzini, Rohitashv Kumar

From: Rohitashv Kumar <roohiit@amazon.de>

QEMU can be built with the i440fx/pc machine type compiled out (for
example via a custom --with-devices-<arch> configuration that only keeps
the q35 machine). In that configuration a few qtests fail because they
hard-code "-machine pc" instead of checking whether the machine is
available.

This series makes the affected tests skip the pc-specific paths when the
"pc" machine is not compiled in, using the existing qtest_has_machine()
helper. There is intentionally NO behaviour change for a normal build
that includes i440fx/pc: the guards only take effect when "pc" is absent,
so existing CI coverage is unchanged.

For device-plug-test and drive_del-test the guard is placed inside the
x86-only branch that adds "-machine pc", so coverage on other
architectures (which use the default machine) is preserved, and x86
coverage is still provided by the existing q35 variants. For pxe-test the
per-row check mirrors the existing per-row qtest_has_device() guard, so
q35 rows keep running when pc is gone.

Tested by building QEMU with and without the i440fx/pc machine: with it
present all affected tests run as before; with CONFIG_I440FX=n the pc
cases skip instead of failing.

Rohitashv Kumar (3):
  tests/qtest/device-plug-test: skip pc tests when 'pc' machine is
    unavailable
  tests/qtest/drive_del-test: skip pc tests when 'pc' machine is
    unavailable
  tests/qtest/pxe-test: skip per-row cases whose machine is unavailable

 tests/qtest/device-plug-test.c |  8 ++++++++
 tests/qtest/drive_del-test.c   | 16 ++++++++++++++++
 tests/qtest/pxe-test.c         |  4 ++++
 3 files changed, 28 insertions(+)

-- 
2.47.3



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] tests/qtest/device-plug-test: skip pc tests when 'pc' machine is unavailable
  2026-07-17  8:18 [PATCH 0/3] tests/qtest: make PCI tests resilient to a compiled-out i440fx/pc machine Rohitashv Kumar
@ 2026-07-17  8:18 ` Rohitashv Kumar
  2026-07-17  8:18 ` [PATCH 2/3] tests/qtest/drive_del-test: " Rohitashv Kumar
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Rohitashv Kumar @ 2026-07-17  8:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Fabiano Rosas, Laurent Vivier, Paolo Bonzini, Rohitashv Kumar

From: Rohitashv Kumar <roohiit@amazon.de>

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>
---
 tests/qtest/device-plug-test.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tests/qtest/device-plug-test.c b/tests/qtest/device-plug-test.c
index 2707ee59..650956fa 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";
     }
 
-- 
2.47.3



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] tests/qtest/drive_del-test: skip pc tests when 'pc' machine is unavailable
  2026-07-17  8:18 [PATCH 0/3] tests/qtest: make PCI tests resilient to a compiled-out i440fx/pc machine Rohitashv Kumar
  2026-07-17  8:18 ` [PATCH 1/3] tests/qtest/device-plug-test: skip pc tests when 'pc' machine is unavailable Rohitashv Kumar
@ 2026-07-17  8:18 ` Rohitashv Kumar
  2026-07-17  8:18 ` [PATCH 3/3] tests/qtest/pxe-test: skip per-row cases whose " Rohitashv Kumar
  2026-08-19 13:12 ` [PATCH 0/3] tests/qtest: make PCI tests resilient to a compiled-out i440fx/pc machine Fabiano Rosas
  3 siblings, 0 replies; 5+ messages in thread
From: Rohitashv Kumar @ 2026-07-17  8:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Fabiano Rosas, Laurent Vivier, Paolo Bonzini, Rohitashv Kumar

From: Rohitashv Kumar <roohiit@amazon.de>

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>
---
 tests/qtest/drive_del-test.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/tests/qtest/drive_del-test.c b/tests/qtest/drive_del-test.c
index 30d9451d..4c32da59 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";
     }
 
-- 
2.47.3



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] tests/qtest/pxe-test: skip per-row cases whose machine is unavailable
  2026-07-17  8:18 [PATCH 0/3] tests/qtest: make PCI tests resilient to a compiled-out i440fx/pc machine Rohitashv Kumar
  2026-07-17  8:18 ` [PATCH 1/3] tests/qtest/device-plug-test: skip pc tests when 'pc' machine is unavailable Rohitashv Kumar
  2026-07-17  8:18 ` [PATCH 2/3] tests/qtest/drive_del-test: " Rohitashv Kumar
@ 2026-07-17  8:18 ` Rohitashv Kumar
  2026-08-19 13:12 ` [PATCH 0/3] tests/qtest: make PCI tests resilient to a compiled-out i440fx/pc machine Fabiano Rosas
  3 siblings, 0 replies; 5+ messages in thread
From: Rohitashv Kumar @ 2026-07-17  8:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Fabiano Rosas, Laurent Vivier, Paolo Bonzini, Rohitashv Kumar

From: Rohitashv Kumar <roohiit@amazon.de>

The x86 test table mixes 'pc' and 'q35' rows. When QEMU is built without
the i440fx/pc machine, the 'pc' rows fail with "unsupported machine type".

Add a per-row qtest_has_machine() check in test_batch(), mirroring the
existing per-row qtest_has_device() guard, so rows for an unavailable
machine are skipped while the others (e.g. q35) still run.

Signed-off-by: Rohitashv Kumar <roohiit@amazon.de>
---
 tests/qtest/pxe-test.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/qtest/pxe-test.c b/tests/qtest/pxe-test.c
index a3f900fb..e85dec5a 100644
--- a/tests/qtest/pxe-test.c
+++ b/tests/qtest/pxe-test.c
@@ -108,6 +108,10 @@ static void test_batch(const testdef_t *tests, bool ipv6)
         const testdef_t *test = &tests[i];
         char *testname;
 
+        if (!qtest_has_machine(test->machine)) {
+            continue;
+        }
+
         if (!qtest_has_device(test->model)) {
             continue;
         }
-- 
2.47.3



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/3] tests/qtest: make PCI tests resilient to a compiled-out i440fx/pc machine
  2026-07-17  8:18 [PATCH 0/3] tests/qtest: make PCI tests resilient to a compiled-out i440fx/pc machine Rohitashv Kumar
                   ` (2 preceding siblings ...)
  2026-07-17  8:18 ` [PATCH 3/3] tests/qtest/pxe-test: skip per-row cases whose " Rohitashv Kumar
@ 2026-08-19 13:12 ` Fabiano Rosas
  3 siblings, 0 replies; 5+ messages in thread
From: Fabiano Rosas @ 2026-08-19 13:12 UTC (permalink / raw)
  To: Rohitashv Kumar, qemu-devel
  Cc: Laurent Vivier, Paolo Bonzini, Rohitashv Kumar

Rohitashv Kumar <rohit.kuma1313@gmail.com> writes:

> From: Rohitashv Kumar <roohiit@amazon.de>
>
> QEMU can be built with the i440fx/pc machine type compiled out (for
> example via a custom --with-devices-<arch> configuration that only keeps
> the q35 machine). In that configuration a few qtests fail because they
> hard-code "-machine pc" instead of checking whether the machine is
> available.
>
> This series makes the affected tests skip the pc-specific paths when the
> "pc" machine is not compiled in, using the existing qtest_has_machine()
> helper. There is intentionally NO behaviour change for a normal build
> that includes i440fx/pc: the guards only take effect when "pc" is absent,
> so existing CI coverage is unchanged.
>
> For device-plug-test and drive_del-test the guard is placed inside the
> x86-only branch that adds "-machine pc", so coverage on other
> architectures (which use the default machine) is preserved, and x86
> coverage is still provided by the existing q35 variants. For pxe-test the
> per-row check mirrors the existing per-row qtest_has_device() guard, so
> q35 rows keep running when pc is gone.
>
> Tested by building QEMU with and without the i440fx/pc machine: with it
> present all affected tests run as before; with CONFIG_I440FX=n the pc
> cases skip instead of failing.
>
> Rohitashv Kumar (3):
>   tests/qtest/device-plug-test: skip pc tests when 'pc' machine is
>     unavailable
>   tests/qtest/drive_del-test: skip pc tests when 'pc' machine is
>     unavailable
>   tests/qtest/pxe-test: skip per-row cases whose machine is unavailable
>
>  tests/qtest/device-plug-test.c |  8 ++++++++
>  tests/qtest/drive_del-test.c   | 16 ++++++++++++++++
>  tests/qtest/pxe-test.c         |  4 ++++
>  3 files changed, 28 insertions(+)

Queued, thanks!


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-08-19 13:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-17  8:18 [PATCH 0/3] tests/qtest: make PCI tests resilient to a compiled-out i440fx/pc machine Rohitashv Kumar
2026-07-17  8:18 ` [PATCH 1/3] tests/qtest/device-plug-test: skip pc tests when 'pc' machine is unavailable Rohitashv Kumar
2026-07-17  8:18 ` [PATCH 2/3] tests/qtest/drive_del-test: " Rohitashv Kumar
2026-07-17  8:18 ` [PATCH 3/3] tests/qtest/pxe-test: skip per-row cases whose " Rohitashv Kumar
2026-08-19 13:12 ` [PATCH 0/3] tests/qtest: make PCI tests resilient to a compiled-out i440fx/pc machine Fabiano Rosas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.