On 2/7/23 14:25, Thomas Huth wrote:
On 06/02/2023 16.04, Fabiano Rosas wrote:
The virtconsole device might not be present in the QEMU build that is
being tested. Skip the test if that's the case.

Signed-off-by: Fabiano Rosas <faro...@suse.de>
---
  tests/qtest/virtio-serial-test.c | 4 ++++
  1 file changed, 4 insertions(+)

diff --git a/tests/qtest/virtio-serial-test.c b/tests/qtest/virtio-serial-test.c
index 2541034822..f4e05e8fdd 100644
--- a/tests/qtest/virtio-serial-test.c
+++ b/tests/qtest/virtio-serial-test.c
@@ -28,6 +28,10 @@ static void register_virtio_serial_test(void)
  {
      QOSGraphTestOptions opts = { };
+    if (!qtest_has_device("virtconsole")) {
+        return;
+    }
+
      opts.edge.before_cmd_line = "-device virtconsole,bus=vser0.0";
      qos_add_test("console-nop", "virtio-serial", virtio_serial_nop, &opts);

virtio-serial-test.c is a qos test - and this should detect automatically already whether a device is available and pluggable or not, I think.

There must be something else wrong here ... Laurent, Paolo, any ideas?

I think the checking of the device should be added where the device is added to the qos tree, in libqos/virtio-serial.c

If you don't add the device then the test is not started.

If I remember correctly, there was no autodetection of the devices, all are 
added statically.

Thanks,
Laurent


Reply via email to