diff options
author | Thomas Huth | 2019-07-22 17:10:55 +0200 |
---|---|---|
committer | Thomas Huth | 2019-08-15 19:24:10 +0200 |
commit | e5758de4e836c3b2edc2befd904651fc6967d74f (patch) | |
tree | 324827884570aa10cb22024f8735e43178e3a947 /tests/libqtest.h | |
parent | tests/libqtest: Clean up qtest_cb_for_every_machine() wrt global_qtest (diff) | |
download | qemu-e5758de4e836c3b2edc2befd904651fc6967d74f.tar.gz qemu-e5758de4e836c3b2edc2befd904651fc6967d74f.tar.xz qemu-e5758de4e836c3b2edc2befd904651fc6967d74f.zip |
tests/libqtest: Make qtest_qmp_device_add/del independent from global_qtest
Generic library functions like qtest_qmp_device_add() and _del()
should not depend on the global_qtest variable. Pass the test
state via parameter instead.
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20190813093047.27948-6-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests/libqtest.h')
-rw-r--r-- | tests/libqtest.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/libqtest.h b/tests/libqtest.h index 0009b65791..d93144fb74 100644 --- a/tests/libqtest.h +++ b/tests/libqtest.h @@ -946,6 +946,7 @@ void qtest_cb_for_every_machine(void (*cb)(const char *machine), /** * qtest_qmp_device_add: + * @qts: QTestState instance to operate on * @driver: Name of the device that should be added * @id: Identification string * @fmt...: QMP message to send to qemu, formatted like @@ -954,16 +955,17 @@ void qtest_cb_for_every_machine(void (*cb)(const char *machine), * * Generic hot-plugging test via the device_add QMP command. */ -void qtest_qmp_device_add(const char *driver, const char *id, const char *fmt, - ...) GCC_FMT_ATTR(3, 4); +void qtest_qmp_device_add(QTestState *qts, const char *driver, const char *id, + const char *fmt, ...) GCC_FMT_ATTR(4, 5); /** * qtest_qmp_device_del: + * @qts: QTestState instance to operate on * @id: Identification string * * Generic hot-unplugging test via the device_del QMP command. */ -void qtest_qmp_device_del(const char *id); +void qtest_qmp_device_del(QTestState *qts, const char *id); /** * qmp_rsp_is_err: |