diff mbox series

[PULL,05/20] migration: Report error in incoming migration

Message ID 20240116031947.69017-6-peterx@redhat.com
State New
Headers show
Series [PULL,01/20] migration: Simplify initial conditionals in migration for better readability | expand

Commit Message

Peter Xu Jan. 16, 2024, 3:19 a.m. UTC
From: Fabiano Rosas <farosas@suse.de>

We're not currently reporting the errors set with migrate_set_error()
when incoming migration fails.

Signed-off-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Peter Xu <peterx@redhat.com>
Link: https://lore.kernel.org/r/20240104142144.9680-5-farosas@suse.de
Signed-off-by: Peter Xu <peterx@redhat.com>
---
 migration/migration.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/migration/migration.c b/migration/migration.c
index 2365a3a13c..219447dea1 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -697,6 +697,13 @@  process_incoming_migration_co(void *opaque)
     }
 
     if (ret < 0) {
+        MigrationState *s = migrate_get_current();
+
+        if (migrate_has_error(s)) {
+            WITH_QEMU_LOCK_GUARD(&s->error_mutex) {
+                error_report_err(s->error);
+            }
+        }
         error_report("load of migration failed: %s", strerror(-ret));
         goto fail;
     }