Skip to content

Commit

Permalink
tests/qtest/migration: Print migration incoming errors
Browse files Browse the repository at this point in the history
We're currently just asserting when incoming migration fails. Let's
print the error message from QMP as well.

Signed-off-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Peter Xu <peterx@redhat.com>
Link: https://lore.kernel.org/r/20240104142144.9680-6-farosas@suse.de
Signed-off-by: Peter Xu <peterx@redhat.com>
  • Loading branch information
Fabiano Rosas authored and xzpeter committed Jan 16, 2024
1 parent e3b8ad5 commit 679a738
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/qtest/migration-helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ void migrate_incoming_qmp(QTestState *to, const char *uri, const char *fmt, ...)

rsp = qtest_qmp(to, "{ 'execute': 'migrate-incoming', 'arguments': %p}",
args);

if (!qdict_haskey(rsp, "return")) {
g_autoptr(GString) s = qobject_to_json_pretty(QOBJECT(rsp), true);
g_test_message("%s", s->str);
}

g_assert(qdict_haskey(rsp, "return"));
qobject_unref(rsp);

Expand Down

0 comments on commit 679a738

Please sign in to comment.