summary refs log tree commit diff stats
path: root/migration/ram.c
diff options
context:
space:
mode:
authorFabiano Rosas <farosas@suse.de>2025-02-13 14:59:19 -0300
committerFabiano Rosas <farosas@suse.de>2025-02-14 15:19:05 -0300
commita47f0cfba8d33f7001bcc4616f96e42dbd553135 (patch)
treea0e19c2be012aeb1ce67e49c5a8de4c19c168a1a /migration/ram.c
parente0ad300fe1a0e0b12b90994bab6e4df77dd1ee8a (diff)
downloadfocaccia-qemu-a47f0cfba8d33f7001bcc4616f96e42dbd553135.tar.gz
focaccia-qemu-a47f0cfba8d33f7001bcc4616f96e42dbd553135.zip
migration: Set migration error outside of migrate_cancel
There's no point passing the error into migration cancel only for it
to call migrate_set_error().

Reviewed-by: Peter Xu <peterx@redhat.com>
Message-ID: <20250213175927.19642-2-farosas@suse.de>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Diffstat (limited to 'migration/ram.c')
-rw-r--r--migration/ram.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/migration/ram.c b/migration/ram.c
index 6f460fd22d..589b6505eb 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -4465,8 +4465,10 @@ static void ram_mig_ram_block_resized(RAMBlockNotifier *n, void *host,
          * Abort and indicate a proper reason.
          */
         error_setg(&err, "RAM block '%s' resized during precopy.", rb->idstr);
-        migration_cancel(err);
+        migrate_set_error(migrate_get_current(), err);
         error_free(err);
+
+        migration_cancel();
     }
 
     switch (ps) {