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>
This commit is contained in:
Fabiano Rosas 2024-04-30 11:27:34 -03:00
parent 61c4e39f73
commit 18d154f575
13 changed files with 25 additions and 300 deletions

View file

@ -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;
}