diff options
author | Thomas Huth <thuth@redhat.com> | 2019-07-22 17:10:55 +0200 |
---|---|---|
committer | Thomas Huth <thuth@redhat.com> | 2019-08-15 19:24:10 +0200 |
commit | e5758de4e836c3b2edc2befd904651fc6967d74f (patch) | |
tree | 324827884570aa10cb22024f8735e43178e3a947 /tests/usb-hcd-uhci-test.c | |
parent | 17de4741296af8ed3361b14feda130a7d7102987 (diff) | |
download | 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/usb-hcd-uhci-test.c')
-rw-r--r-- | tests/usb-hcd-uhci-test.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/usb-hcd-uhci-test.c b/tests/usb-hcd-uhci-test.c index 6d355c29da..2eef8e3d1c 100644 --- a/tests/usb-hcd-uhci-test.c +++ b/tests/usb-hcd-uhci-test.c @@ -43,14 +43,16 @@ static void test_port_2(void) static void test_uhci_hotplug(void) { - usb_test_hotplug("uhci", "2", test_port_2); + usb_test_hotplug(global_qtest, "uhci", "2", test_port_2); } static void test_usb_storage_hotplug(void) { - qtest_qmp_device_add("usb-storage", "usbdev0", "{'drive': 'drive0'}"); + QTestState *qts = global_qtest; - qtest_qmp_device_del("usbdev0"); + qtest_qmp_device_add(qts, "usb-storage", "usbdev0", "{'drive': 'drive0'}"); + + qtest_qmp_device_del(qts, "usbdev0"); } int main(int argc, char **argv) |