diff options
author | Fabiano Rosas <farosas@suse.de> | 2024-04-30 11:27:34 -0300 |
---|---|---|
committer | Fabiano Rosas <farosas@suse.de> | 2024-05-08 09:20:58 -0300 |
commit | 18d154f57583dd06f0ce3e69e4952044490b2bc4 (patch) | |
tree | c92c1ddefb2f309b849ba93ec72f6dced40a6dfe /migration | |
parent | 61c4e39f7301f67408024346ad3eb5335aec0311 (diff) |
migration: Remove 'blk/-b' option from migrate commands
The block migration is considered obsolete and has been deprecated in
8.2. Remove the migrate command option that enables it. This only
affects the QMP and HMP commands, the feature can still be accessed by
setting the migration 'block' capability. The whole feature will be
removed in a future patch.
Deprecation commit 8846b5bfca ("migration: migrate 'blk' command
option is deprecated.").
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Diffstat (limited to 'migration')
-rw-r--r-- | migration/migration-hmp-cmds.c | 9 | ||||
-rw-r--r-- | migration/migration.c | 31 | ||||
-rw-r--r-- | migration/migration.h | 4 | ||||
-rw-r--r-- | migration/options.c | 14 | ||||
-rw-r--r-- | migration/options.h | 2 |
5 files changed, 6 insertions, 54 deletions
diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c index 8446c0721a..734c1d29ce 100644 --- a/migration/migration-hmp-cmds.c +++ b/migration/migration-hmp-cmds.c @@ -758,26 +758,19 @@ static void hmp_migrate_status_cb(void *opaque) void hmp_migrate(Monitor *mon, const QDict *qdict) { bool detach = qdict_get_try_bool(qdict, "detach", false); - bool blk = qdict_get_try_bool(qdict, "blk", false); bool resume = qdict_get_try_bool(qdict, "resume", false); const char *uri = qdict_get_str(qdict, "uri"); Error *err = NULL; g_autoptr(MigrationChannelList) caps = NULL; g_autoptr(MigrationChannel) channel = NULL; - if (blk) { - warn_report("option '-b' is deprecated;" - " use blockdev-mirror with NBD instead"); - } - if (!migrate_uri_parse(uri, &channel, &err)) { hmp_handle_error(mon, err); return; } QAPI_LIST_PREPEND(caps, g_steal_pointer(&channel)); - qmp_migrate(NULL, true, caps, !!blk, blk, false, false, - true, resume, &err); + qmp_migrate(NULL, true, caps, false, false, true, resume, &err); if (hmp_handle_error(mon, err)) { return; } diff --git a/migration/migration.c b/migration/migration.c index 11a13fa20c..91327b98c5 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1935,14 +1935,8 @@ bool migration_is_blocked(Error **errp) } /* Returns true if continue to migrate, or false if error detected */ -static bool migrate_prepare(MigrationState *s, bool blk, bool resume, - Error **errp) +static bool migrate_prepare(MigrationState *s, bool resume, Error **errp) { - if (blk) { - warn_report("parameter 'blk' is deprecated;" - " use blockdev-mirror with NBD instead"); - } - if (resume) { if (s->state != MIGRATION_STATUS_POSTCOPY_PAUSED) { error_setg(errp, "Cannot resume if there is no " @@ -2027,22 +2021,6 @@ static bool migrate_prepare(MigrationState *s, bool blk, bool resume, } } - if (blk) { - if (migrate_colo()) { - error_setg(errp, "No disk migration is required in COLO mode"); - return false; - } - if (migrate_block()) { - error_setg(errp, "Command options are incompatible with " - "current migration capabilities"); - return false; - } - if (!migrate_cap_set(MIGRATION_CAPABILITY_BLOCK, true, errp)) { - return false; - } - s->must_remove_block_options = true; - } - if (migrate_init(s, errp)) { return false; } @@ -2051,9 +2029,8 @@ static bool migrate_prepare(MigrationState *s, bool blk, bool resume, } void qmp_migrate(const char *uri, bool has_channels, - MigrationChannelList *channels, bool has_blk, bool blk, - bool has_detach, bool detach, bool has_resume, bool resume, - Error **errp) + MigrationChannelList *channels, bool has_detach, bool detach, + bool has_resume, bool resume, Error **errp) { bool resume_requested; Error *local_err = NULL; @@ -2092,7 +2069,7 @@ void qmp_migrate(const char *uri, bool has_channels, } resume_requested = has_resume && resume; - if (!migrate_prepare(s, has_blk && blk, resume_requested, errp)) { + if (!migrate_prepare(s, resume_requested, errp)) { /* Error detected, put into errp */ return; } diff --git a/migration/migration.h b/migration/migration.h index f3406c43c8..a02c2ec782 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -379,10 +379,6 @@ struct MigrationState { /* mutex to protect errp */ QemuMutex error_mutex; - /* Do we have to clean up -b/-i from old migrate parameters */ - /* This feature is deprecated and will be removed */ - bool must_remove_block_options; - /* * Global switch on whether we need to store the global state * during migration. diff --git a/migration/options.c b/migration/options.c index 5b16d99bd9..856b2fa33c 100644 --- a/migration/options.c +++ b/migration/options.c @@ -486,8 +486,7 @@ bool migrate_caps_check(bool *old_caps, bool *new_caps, Error **errp) #ifndef CONFIG_LIVE_BLOCK_MIGRATION if (new_caps[MIGRATION_CAPABILITY_BLOCK]) { - error_setg(errp, "QEMU compiled without old-style (blk/-b) " - "block migration"); + error_setg(errp, "QEMU compiled without old-style block migration"); error_append_hint(errp, "Use blockdev-mirror with NBD instead.\n"); return false; } @@ -943,17 +942,6 @@ ZeroPageDetection migrate_zero_page_detection(void) /* parameters helpers */ -void block_cleanup_parameters(void) -{ - MigrationState *s = migrate_get_current(); - - if (s->must_remove_block_options) { - /* setting to false can never fail */ - migrate_cap_set(MIGRATION_CAPABILITY_BLOCK, false, &error_abort); - s->must_remove_block_options = false; - } -} - AnnounceParameters *migrate_announce_params(void) { static AnnounceParameters ap; diff --git a/migration/options.h b/migration/options.h index fa5eb177df..e9cb60444f 100644 --- a/migration/options.h +++ b/migration/options.h @@ -95,6 +95,4 @@ ZeroPageDetection migrate_zero_page_detection(void); bool migrate_params_check(MigrationParameters *params, Error **errp); void migrate_params_init(MigrationParameters *params); -void block_cleanup_parameters(void); - #endif |