[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 7/9] tests/libqtest: Clean up qtest_cb_for_every_mach
From: |
Thomas Huth |
Subject: |
[Qemu-devel] [PULL 7/9] tests/libqtest: Clean up qtest_cb_for_every_machine() wrt global_qtest |
Date: |
Thu, 15 Aug 2019 19:59:20 +0200 |
The generic libqtest library functions should not use functions that
require the global_qtest variable.
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Thomas Huth <address@hidden>
---
tests/libqtest.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/tests/libqtest.c b/tests/libqtest.c
index 3e9245d4c9..d1aead30ed 100644
--- a/tests/libqtest.c
+++ b/tests/libqtest.c
@@ -1189,9 +1189,10 @@ void qtest_cb_for_every_machine(void (*cb)(const char
*machine),
QObject *qobj;
QString *qstr;
const char *mname;
+ QTestState *qts;
- qtest_start("-machine none");
- response = qmp("{ 'execute': 'query-machines' }");
+ qts = qtest_init("-machine none");
+ response = qtest_qmp(qts, "{ 'execute': 'query-machines' }");
g_assert(response);
list = qdict_get_qlist(response, "return");
g_assert(list);
@@ -1209,7 +1210,7 @@ void qtest_cb_for_every_machine(void (*cb)(const char
*machine),
}
}
- qtest_end();
+ qtest_quit(qts);
qobject_unref(response);
}
--
2.18.1
- [Qemu-devel] [PULL 0/9] qtest patches, Thomas Huth, 2019/08/15
- [Qemu-devel] [PULL 1/9] qtest: Rename qtest.c:qtest_init(), Thomas Huth, 2019/08/15
- [Qemu-devel] [PULL 2/9] libqos: Account for the ctrl queue in virtio-net, Thomas Huth, 2019/08/15
- [Qemu-devel] [PULL 3/9] tests: Set read-zeroes on for null-co driver, Thomas Huth, 2019/08/15
- [Qemu-devel] [PULL 5/9] tests/libqos: Make virtio-pci code independent from global_qtest, Thomas Huth, 2019/08/15
- [Qemu-devel] [PULL 4/9] tests/libqos: Make generic virtio code independent from global_qtest, Thomas Huth, 2019/08/15
- [Qemu-devel] [PULL 7/9] tests/libqtest: Clean up qtest_cb_for_every_machine() wrt global_qtest,
Thomas Huth <=
- [Qemu-devel] [PULL 6/9] tests/libqtest: Remove unused function hmp(), Thomas Huth, 2019/08/15
- [Qemu-devel] [PULL 9/9] tests/libqtest: Make qmp_assert_success() independent from global_qtest, Thomas Huth, 2019/08/15
- [Qemu-devel] [PULL 8/9] tests/libqtest: Make qtest_qmp_device_add/del independent from global_qtest, Thomas Huth, 2019/08/15
- Re: [Qemu-devel] [PULL 0/9] qtest patches, no-reply, 2019/08/15
- Re: [Qemu-devel] [PULL 0/9] qtest patches, Peter Maydell, 2019/08/16