diff options
author | Rao, Lei <lei.rao@intel.com> | 2021-06-08 16:23:28 +0800 |
---|---|---|
committer | Jason Wang <jasowang@redhat.com> | 2021-06-11 10:30:13 +0800 |
commit | 3ba024457facdb6b0ef9c5c742261d4080a80a11 (patch) | |
tree | 381771eb6d52d507aeee4b50de203a7afeec7398 | |
parent | 7c2eae9a77234f92be96d33cc20b990db714d86d (diff) | |
download | qemu-3ba024457facdb6b0ef9c5c742261d4080a80a11.zip qemu-3ba024457facdb6b0ef9c5c742261d4080a80a11.tar.gz qemu-3ba024457facdb6b0ef9c5c742261d4080a80a11.tar.bz2 |
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>
-rw-r--r-- | migration/colo.c | 6 | ||||
-rw-r--r-- | migration/migration.c | 4 |
2 files changed, 4 insertions, 6 deletions
diff --git a/migration/colo.c b/migration/colo.c index e498fdb..79fa1f6 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -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 diff --git a/migration/migration.c b/migration/migration.c index 393299e..4828997 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -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"); |