diff options
author | Juan Quintela <quintela@redhat.com> | 2023-03-01 22:23:57 +0100 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2023-04-24 15:01:46 +0200 |
commit | 9d4b1e5f22a838285ebeb8f0eb7cc8df1161998f (patch) | |
tree | 0edfd2c28ad1a622d2c0578f98145e111c04de09 /migration | |
parent | 87dca0c9bb63014ef73ad82f7aedea1cb5a822e7 (diff) | |
download | qemu-9d4b1e5f22a838285ebeb8f0eb7cc8df1161998f.zip qemu-9d4b1e5f22a838285ebeb8f0eb7cc8df1161998f.tar.gz qemu-9d4b1e5f22a838285ebeb8f0eb7cc8df1161998f.tar.bz2 |
migration: Move migrate_use_block() to options.c
Once that we are there, we rename the function to migrate_block()
to be consistent with all other capabilities.
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Diffstat (limited to 'migration')
-rw-r--r-- | migration/block.c | 2 | ||||
-rw-r--r-- | migration/migration.c | 11 | ||||
-rw-r--r-- | migration/migration.h | 1 | ||||
-rw-r--r-- | migration/options.c | 9 | ||||
-rw-r--r-- | migration/options.h | 1 | ||||
-rw-r--r-- | migration/savevm.c | 2 |
6 files changed, 13 insertions, 13 deletions
diff --git a/migration/block.c b/migration/block.c index 4b167fa..f097721 100644 --- a/migration/block.c +++ b/migration/block.c @@ -1001,7 +1001,7 @@ static int block_load(QEMUFile *f, void *opaque, int version_id) static bool block_is_active(void *opaque) { - return migrate_use_block(); + return migrate_block(); } static SaveVMHandlers savevm_block_handlers = { diff --git a/migration/migration.c b/migration/migration.c index abb820c..1f8ba94 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2415,7 +2415,7 @@ static bool migrate_prepare(MigrationState *s, bool blk, bool blk_inc, error_setg(errp, "No disk migration is required in COLO mode"); return false; } - if (migrate_use_block() || migrate_use_block_incremental()) { + if (migrate_block() || migrate_use_block_incremental()) { error_setg(errp, "Command options are incompatible with " "current migration capabilities"); return false; @@ -2622,15 +2622,6 @@ static int64_t migrate_max_postcopy_bandwidth(void) return s->parameters.max_postcopy_bandwidth; } -bool migrate_use_block(void) -{ - MigrationState *s; - - s = migrate_get_current(); - - return s->capabilities[MIGRATION_CAPABILITY_BLOCK]; -} - bool migrate_use_return_path(void) { MigrationState *s; diff --git a/migration/migration.h b/migration/migration.h index e2bb5b1..d4b68b0 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -457,7 +457,6 @@ int migrate_multifd_zstd_level(void); int migrate_use_tls(void); uint64_t migrate_xbzrle_cache_size(void); -bool migrate_use_block(void); bool migrate_use_block_incremental(void); int migrate_max_cpu_throttle(void); bool migrate_use_return_path(void); diff --git a/migration/options.c b/migration/options.c index 25264c5..fe1eade 100644 --- a/migration/options.c +++ b/migration/options.c @@ -33,6 +33,15 @@ bool migrate_background_snapshot(void) return s->capabilities[MIGRATION_CAPABILITY_BACKGROUND_SNAPSHOT]; } +bool migrate_block(void) +{ + MigrationState *s; + + s = migrate_get_current(); + + return s->capabilities[MIGRATION_CAPABILITY_BLOCK]; +} + bool migrate_colo(void) { MigrationState *s = migrate_get_current(); diff --git a/migration/options.h b/migration/options.h index 8f76a88..e985a52 100644 --- a/migration/options.h +++ b/migration/options.h @@ -18,6 +18,7 @@ bool migrate_auto_converge(void); bool migrate_background_snapshot(void); +bool migrate_block(void); bool migrate_colo(void); bool migrate_compress(void); bool migrate_dirty_bitmaps(void); diff --git a/migration/savevm.c b/migration/savevm.c index ebcf571..9671211 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1612,7 +1612,7 @@ static int qemu_savevm_state(QEMUFile *f, Error **errp) return -EINVAL; } - if (migrate_use_block()) { + if (migrate_block()) { error_setg(errp, "Block migration and snapshots are incompatible"); return -EINVAL; } |