mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
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>
This commit is contained in:
parent
c45a70d8c2
commit
bb1a5b97f7
5 changed files with 15 additions and 22 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue