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);
 
-- 
2.35.3


Reply via email to