summary refs log tree commit diff stats
path: root/tests/qtest/libqos
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2021-12-20 09:10:51 +0100
committerThomas Huth <thuth@redhat.com>2021-12-22 08:13:05 +0100
commitad9e129b0162a1342a407c8d8e2073e4562206f2 (patch)
treeb857f210baa949e27090fb44a4d7baab8c116610 /tests/qtest/libqos
parent487cf3f2b23e08dacdab0ebc7aaa12e03f65c822 (diff)
downloadfocaccia-qemu-ad9e129b0162a1342a407c8d8e2073e4562206f2.tar.gz
focaccia-qemu-ad9e129b0162a1342a407c8d8e2073e4562206f2.zip
tests/qtest: Add a function that checks whether a device is available
Devices might not always be compiled into the QEMU target binaries.
We already have the libqos framework that is good for handling such
situations, but some of the qtests are not a real good fit for the
libqos framework. Let's add a qtest_has_device() function for such
tests instead.

Message-Id: <20211220081054.151515-2-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests/qtest/libqos')
-rw-r--r--tests/qtest/libqos/libqtest.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/qtest/libqos/libqtest.h b/tests/qtest/libqos/libqtest.h
index a6d38d7ef7..cf38d273f5 100644
--- a/tests/qtest/libqos/libqtest.h
+++ b/tests/qtest/libqos/libqtest.h
@@ -719,6 +719,14 @@ void qtest_cb_for_every_machine(void (*cb)(const char *machine),
 bool qtest_has_machine(const char *machine);
 
 /**
+ * qtest_has_device:
+ * @device: The device to look for
+ *
+ * Returns: true if the device is available in the target binary.
+ */
+bool qtest_has_device(const char *device);
+
+/**
  * qtest_qmp_device_add_qdict:
  * @qts: QTestState instance to operate on
  * @drv: Name of the device that should be added