aboutsummaryrefslogtreecommitdiff
path: root/tests/qtest/migration-helpers.c
diff options
context:
space:
mode:
authorFabiano Rosas <farosas@suse.de>2024-01-04 11:21:42 -0300
committerPeter Xu <peterx@redhat.com>2024-01-16 11:16:09 +0800
commit679a7382a389875c0f7835a1a409ebf4859f8410 (patch)
treef5a7cb9d9eb0de669d8ac01b1cf54dc32702c947 /tests/qtest/migration-helpers.c
parente3b8ad5c13714cca5e3fc1445472171fbcd469bc (diff)
tests/qtest/migration: Print migration incoming errors
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>
Diffstat (limited to 'tests/qtest/migration-helpers.c')
-rw-r--r--tests/qtest/migration-helpers.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/qtest/migration-helpers.c b/tests/qtest/migration-helpers.c
index 37e8e812c5..19384e3fa6 100644
--- a/tests/qtest/migration-helpers.c
+++ b/tests/qtest/migration-helpers.c
@@ -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);