ソースを参照

Remove migrate_set_block_enabled in checkpoint

We can detect disk migration in migrate_prepare, if disk migration
is enabled in COLO mode, we can directly report an error.and there
is no need to disable block migration at every checkpoint.

Signed-off-by: Lei Rao <lei.rao@intel.com>
Signed-off-by: Zhang Chen <chen.zhang@intel.com>
Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>
Reviewed-by: Zhang Chen <chen.zhang@intel.com>
Reviewed-by: Lukas Straub <lukasstraub2@web.de>
Tested-by: Lukas Straub <lukasstraub2@web.de>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Rao, Lei 4 年 前
コミット
3ba024457f
2 ファイル変更4 行追加6 行削除
  1. 0 6
      migration/colo.c
  2. 4 0
      migration/migration.c

+ 0 - 6
migration/colo.c

@@ -435,12 +435,6 @@ static int colo_do_checkpoint_transaction(MigrationState *s,
     if (failover_get_state() != FAILOVER_STATUS_NONE) {
     if (failover_get_state() != FAILOVER_STATUS_NONE) {
         goto out;
         goto out;
     }
     }
-
-    /* Disable block migration */
-    migrate_set_block_enabled(false, &local_err);
-    if (local_err) {
-        goto out;
-    }
     qemu_mutex_lock_iothread();
     qemu_mutex_lock_iothread();
 
 
 #ifdef CONFIG_REPLICATION
 #ifdef CONFIG_REPLICATION

+ 4 - 0
migration/migration.c

@@ -2217,6 +2217,10 @@ static bool migrate_prepare(MigrationState *s, bool blk, bool blk_inc,
     }
     }
 
 
     if (blk || blk_inc) {
     if (blk || blk_inc) {
+        if (migrate_colo_enabled()) {
+            error_setg(errp, "No disk migration is required in COLO mode");
+            return false;
+        }
         if (migrate_use_block() || migrate_use_block_incremental()) {
         if (migrate_use_block() || migrate_use_block_incremental()) {
             error_setg(errp, "Command options are incompatible with "
             error_setg(errp, "Command options are incompatible with "
                        "current migration capabilities");
                        "current migration capabilities");