Once that we are there, we rename the function to migrate_colo() to be consistent with all other capabilities.
Signed-off-by: Juan Quintela <quint...@redhat.com> --- migration/migration.h | 1 - migration/options.h | 1 + migration/migration.c | 16 +++++----------- migration/options.c | 6 ++++++ 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/migration/migration.h b/migration/migration.h index 68851e485d..1ac11fdba9 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -424,7 +424,6 @@ bool migrate_use_zero_copy_send(void); int migrate_use_tls(void); int migrate_use_xbzrle(void); uint64_t migrate_xbzrle_cache_size(void); -bool migrate_colo_enabled(void); bool migrate_use_block(void); bool migrate_use_block_incremental(void); diff --git a/migration/options.h b/migration/options.h index bae032375a..5d2d4298cd 100644 --- a/migration/options.h +++ b/migration/options.h @@ -20,6 +20,7 @@ bool migrate_auto_converge(void); bool migrate_background_snapshot(void); +bool migrate_colo(void); bool migrate_dirty_bitmaps(void); bool migrate_ignore_shared(void); bool migrate_late_block_activate(void); diff --git a/migration/migration.c b/migration/migration.c index 790848ef1c..03884f2f73 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2409,7 +2409,7 @@ static bool migrate_prepare(MigrationState *s, bool blk, bool blk_inc, } if (blk || blk_inc) { - if (migrate_colo_enabled()) { + if (migrate_colo()) { error_setg(errp, "No disk migration is required in COLO mode"); return false; } @@ -3290,7 +3290,7 @@ static void migration_completion(MigrationState *s) ret = global_state_store(); if (!ret) { - bool inactivate = !migrate_colo_enabled(); + bool inactivate = !migrate_colo(); ret = vm_stop_force_state(RUN_STATE_FINISH_MIGRATE); trace_migration_completion_vm_stop(ret); if (ret >= 0) { @@ -3349,7 +3349,7 @@ static void migration_completion(MigrationState *s) goto fail_invalidate; } - if (migrate_colo_enabled() && s->state == MIGRATION_STATUS_ACTIVE) { + if (migrate_colo() && s->state == MIGRATION_STATUS_ACTIVE) { /* COLO does not support postcopy */ migrate_set_state(&s->state, MIGRATION_STATUS_ACTIVE, MIGRATION_STATUS_COLO); @@ -3427,12 +3427,6 @@ fail: MIGRATION_STATUS_FAILED); } -bool migrate_colo_enabled(void) -{ - MigrationState *s = migrate_get_current(); - return s->capabilities[MIGRATION_CAPABILITY_X_COLO]; -} - typedef enum MigThrError { /* No error detected */ MIG_THR_ERR_NONE = 0, @@ -3763,7 +3757,7 @@ static void migration_iteration_finish(MigrationState *s) runstate_set(RUN_STATE_POSTMIGRATE); break; case MIGRATION_STATUS_COLO: - if (!migrate_colo_enabled()) { + if (!migrate_colo()) { error_report("%s: critical error: calling COLO code without " "COLO enabled", __func__); } @@ -3959,7 +3953,7 @@ static void *migration_thread(void *opaque) qemu_savevm_send_postcopy_advise(s->to_dst_file); } - if (migrate_colo_enabled()) { + if (migrate_colo()) { /* Notify migration destination that we enable COLO */ qemu_savevm_send_colo_enable(s->to_dst_file); } diff --git a/migration/options.c b/migration/options.c index 47337a9a29..6904d054a9 100644 --- a/migration/options.c +++ b/migration/options.c @@ -35,6 +35,12 @@ bool migrate_background_snapshot(void) return s->capabilities[MIGRATION_CAPABILITY_BACKGROUND_SNAPSHOT]; } +bool migrate_colo(void) +{ + MigrationState *s = migrate_get_current(); + return s->capabilities[MIGRATION_CAPABILITY_X_COLO]; +} + bool migrate_dirty_bitmaps(void) { MigrationState *s; -- 2.39.2