aboutsummaryrefslogtreecommitdiff
path: root/tests/qtest/device-plug-test.c
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2023-05-11 15:41:59 +0200
committerThomas Huth <thuth@redhat.com>2023-05-22 09:44:48 +0200
commit65331bf5d13fda151ecffe81c91fe482da15c3d5 (patch)
treef9d8d8ec556819a6c4a1ce74ae1b7265aa1bc0fb /tests/qtest/device-plug-test.c
parent9a671714615e0b232059e8dcb17359722b607fc9 (diff)
downloadqemu-65331bf5d13fda151ecffe81c91fe482da15c3d5.zip
qemu-65331bf5d13fda151ecffe81c91fe482da15c3d5.tar.gz
qemu-65331bf5d13fda151ecffe81c91fe482da15c3d5.tar.bz2
tests/qtest: Check for the availability of virtio-ccw devices before using them
The devices might not have been compiled into the QEMU binary, so we have to check before we can use them. Message-Id: <20230512124033.502654-16-thuth@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests/qtest/device-plug-test.c')
-rw-r--r--tests/qtest/device-plug-test.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/qtest/device-plug-test.c b/tests/qtest/device-plug-test.c
index 01cecd6..abd544b 100644
--- a/tests/qtest/device-plug-test.c
+++ b/tests/qtest/device-plug-test.c
@@ -156,7 +156,14 @@ static void test_q35_pci_unplug_json_request(void)
static void test_ccw_unplug(void)
{
- QTestState *qtest = qtest_initf("-device virtio-balloon-ccw,id=dev0");
+ QTestState *qtest;
+
+ if (!qtest_has_device("virtio-balloon-ccw")) {
+ g_test_skip("Device virtio-balloon-ccw not available");
+ return;
+ }
+
+ qtest = qtest_initf("-device virtio-balloon-ccw,id=dev0");
qtest_qmp_device_del_send(qtest, "dev0");
wait_device_deleted_event(qtest, "dev0");