aboutsummaryrefslogtreecommitdiff
path: root/tests/qtest/tpm-util.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/tpm-util.c
parentc45a70d8c271056896a057fbcdc7743a2942d0ec (diff)
downloadqemu-bb1a5b97f75ae209d8707f698da23088d7b9bbb5.zip
qemu-bb1a5b97f75ae209d8707f698da23088d7b9bbb5.tar.gz
qemu-bb1a5b97f75ae209d8707f698da23088d7b9bbb5.tar.bz2
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/tpm-util.c')
-rw-r--r--tests/qtest/tpm-util.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/qtest/tpm-util.c b/tests/qtest/tpm-util.c
index 3ed6c85..5a33a6e 100644
--- a/tests/qtest/tpm-util.c
+++ b/tests/qtest/tpm-util.c
@@ -237,12 +237,16 @@ void tpm_util_migrate(QTestState *who, const char *uri)
void tpm_util_wait_for_migration_complete(QTestState *who)
{
while (true) {
+ QDict *rsp;
QDict *rsp_return;
bool completed;
const char *status;
- qtest_qmp_send(who, "{ 'execute': 'query-migrate' }");
- rsp_return = qtest_qmp_receive_success(who, NULL, NULL);
+ rsp = qtest_qmp(who, "{ 'execute': 'query-migrate' }");
+ g_assert(qdict_haskey(rsp, "return"));
+ rsp_return = qdict_get_qdict(rsp, "return");
+
+ g_assert(!qdict_haskey(rsp_return, "error"));
status = qdict_get_str(rsp_return, "status");
completed = strcmp(status, "completed") == 0;
g_assert_cmpstr(status, !=, "failed");