Skip to content

Commit

Permalink
Remove migrate_set_block_enabled in checkpoint
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
raolei-intel authored and jasowang committed Jun 11, 2021
1 parent 7c2eae9 commit 3ba0244
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 0 additions & 6 deletions migration/colo.c
Expand Up @@ -435,12 +435,6 @@ static int colo_do_checkpoint_transaction(MigrationState *s,
if (failover_get_state() != FAILOVER_STATUS_NONE) {
goto out;
}

/* Disable block migration */
migrate_set_block_enabled(false, &local_err);
if (local_err) {
goto out;
}
qemu_mutex_lock_iothread();

#ifdef CONFIG_REPLICATION
Expand Down
4 changes: 4 additions & 0 deletions migration/migration.c
Expand Up @@ -2217,6 +2217,10 @@ static bool migrate_prepare(MigrationState *s, bool blk, bool 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()) {
error_setg(errp, "Command options are incompatible with "
"current migration capabilities");
Expand Down

0 comments on commit 3ba0244

Please sign in to comment.