summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--migration/migration.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/migration/migration.c b/migration/migration.c
index 5543a7f896..298fe16e27 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -3446,13 +3446,11 @@ static void migration_completion(MigrationState *s)
                                             MIGRATION_STATUS_DEVICE);
             }
             if (ret >= 0) {
+                s->block_inactive = inactivate;
                 qemu_file_set_rate_limit(s->to_dst_file, INT64_MAX);
                 ret = qemu_savevm_state_complete_precopy(s->to_dst_file, false,
                                                          inactivate);
             }
-            if (inactivate && ret >= 0) {
-                s->block_inactive = true;
-            }
         }
         qemu_mutex_unlock_iothread();
 
@@ -3524,6 +3522,7 @@ fail_invalidate:
         bdrv_activate_all(&local_err);
         if (local_err) {
             error_report_err(local_err);
+            s->block_inactive = true;
         } else {
             s->block_inactive = false;
         }