aboutsummaryrefslogtreecommitdiff
path: root/tests/qtest/libqtest.c
diff options
context:
space:
mode:
authorMaxim Levitsky <mlevitsk@redhat.com>2020-10-06 15:38:53 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2020-10-12 11:50:49 -0400
commitbb1a5b97f75ae209d8707f698da23088d7b9bbb5 (patch)
treea04a8d4278f942453e434b90160ffb1a723ad501 /tests/qtest/libqtest.c
parentc45a70d8c271056896a057fbcdc7743a2942d0ec (diff)
qtest: switch users back to qtest_qmp_receive
Let test use the new functionality for buffering events. The only remaining users of qtest_qmp_receive_dict are tests that fuzz the QMP protocol. Tested with 'make check-qtest'. Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Message-Id: <20201006123904.610658-4-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tests/qtest/libqtest.c')
-rw-r--r--tests/qtest/libqtest.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c
index baac667b8d..08929f5ff6 100644
--- a/tests/qtest/libqtest.c
+++ b/tests/qtest/libqtest.c
@@ -324,7 +324,7 @@ QTestState *qtest_init(const char *extra_args)
QDict *greeting;
/* Read the QMP greeting and then do the handshake */
- greeting = qtest_qmp_receive_dict(s);
+ greeting = qtest_qmp_receive(s);
qobject_unref(greeting);
qobject_unref(qtest_qmp(s, "{ 'execute': 'qmp_capabilities' }"));
@@ -700,7 +700,7 @@ QDict *qtest_vqmp_fds(QTestState *s, int *fds, size_t fds_num,
qtest_qmp_vsend_fds(s, fds, fds_num, fmt, ap);
/* Receive reply */
- return qtest_qmp_receive_dict(s);
+ return qtest_qmp_receive(s);
}
QDict *qtest_vqmp(QTestState *s, const char *fmt, va_list ap)
@@ -708,7 +708,7 @@ QDict *qtest_vqmp(QTestState *s, const char *fmt, va_list ap)
qtest_qmp_vsend(s, fmt, ap);
/* Receive reply */
- return qtest_qmp_receive_dict(s);
+ return qtest_qmp_receive(s);
}
QDict *qmp_fd(int fd, const char *fmt, ...)
@@ -850,12 +850,6 @@ char *qtest_vhmp(QTestState *s, const char *fmt, va_list ap)
" 'arguments': {'command-line': %s}}",
cmd);
ret = g_strdup(qdict_get_try_str(resp, "return"));
- while (ret == NULL && qdict_get_try_str(resp, "event")) {
- /* Ignore asynchronous QMP events */
- qobject_unref(resp);
- resp = qtest_qmp_receive_dict(s);
- ret = g_strdup(qdict_get_try_str(resp, "return"));
- }
g_assert(ret);
qobject_unref(resp);
g_free(cmd);