summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2019-07-22 16:34:42 +0200
committerThomas Huth <thuth@redhat.com>2019-08-15 19:24:10 +0200
commit17de4741296af8ed3361b14feda130a7d7102987 (patch)
treeba415deb049243b5ad3f4f5cbea25ed214eab94a
parentf945b84a2b1307086efcf97a95702eb74a8aaba5 (diff)
downloadfocaccia-qemu-17de4741296af8ed3361b14feda130a7d7102987.tar.gz
focaccia-qemu-17de4741296af8ed3361b14feda130a7d7102987.zip
tests/libqtest: Clean up qtest_cb_for_every_machine() wrt global_qtest
The generic libqtest library functions should not use functions that
require the global_qtest variable.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20190813093047.27948-5-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
-rw-r--r--tests/libqtest.c7
1 files 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);
 }