aboutsummaryrefslogtreecommitdiff
path: root/tests/qtest/migration-helpers.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/qtest/migration-helpers.c')
-rw-r--r--tests/qtest/migration-helpers.c53
1 files changed, 3 insertions, 50 deletions
diff --git a/tests/qtest/migration-helpers.c b/tests/qtest/migration-helpers.c
index 7ceadecf84..73e506a5f8 100644
--- a/tests/qtest/migration-helpers.c
+++ b/tests/qtest/migration-helpers.c
@@ -36,54 +36,6 @@ bool migrate_watch_for_stop(QTestState *who, const char *name,
return false;
}
-#ifndef _WIN32
-/*
- * Events can get in the way of responses we are actually waiting for.
- */
-QDict *wait_command_fd(QTestState *who, int fd, const char *command, ...)
-{
- va_list ap;
- QDict *resp, *ret;
-
- va_start(ap, command);
- qtest_qmp_vsend_fds(who, &fd, 1, command, ap);
- va_end(ap);
-
- resp = qtest_qmp_receive(who);
-
- g_assert(!qdict_haskey(resp, "error"));
- g_assert(qdict_haskey(resp, "return"));
-
- ret = qdict_get_qdict(resp, "return");
- qobject_ref(ret);
- qobject_unref(resp);
-
- return ret;
-}
-#endif
-
-/*
- * Events can get in the way of responses we are actually waiting for.
- */
-QDict *wait_command(QTestState *who, const char *command, ...)
-{
- va_list ap;
- QDict *resp, *ret;
-
- va_start(ap, command);
- resp = qtest_vqmp(who, command, ap);
- va_end(ap);
-
- g_assert(!qdict_haskey(resp, "error"));
- g_assert(qdict_haskey(resp, "return"));
-
- ret = qdict_get_qdict(resp, "return");
- qobject_ref(ret);
- qobject_unref(resp);
-
- return ret;
-}
-
/*
* Send QMP command "migrate".
* Arguments are built from @fmt... (formatted like
@@ -111,7 +63,7 @@ void migrate_qmp(QTestState *who, const char *uri, const char *fmt, ...)
*/
QDict *migrate_query(QTestState *who)
{
- return wait_command(who, "{ 'execute': 'query-migrate' }");
+ return qtest_qmp_assert_success_ref(who, "{ 'execute': 'query-migrate' }");
}
QDict *migrate_query_not_failed(QTestState *who)
@@ -209,7 +161,8 @@ void wait_for_migration_fail(QTestState *from, bool allow_active)
} while (!failed);
/* Is the machine currently running? */
- rsp_return = wait_command(from, "{ 'execute': 'query-status' }");
+ rsp_return = qtest_qmp_assert_success_ref(from,
+ "{ 'execute': 'query-status' }");
g_assert(qdict_haskey(rsp_return, "running"));
g_assert(qdict_get_bool(rsp_return, "running"));
qobject_unref(rsp_return);