migration: Remove 'inc' option from migrate command

The block incremental option for block migration has been deprecated
in 8.2 in favor of using the block-mirror feature. Remove it now.

Deprecation commit 40101f320d ("migration: migrate 'inc' 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:33 -03:00
parent f7b1cd3c2e
commit 61c4e39f73
9 changed files with 39 additions and 129 deletions

View file

@ -419,7 +419,6 @@ static int init_blk_migration(QEMUFile *f, Error **errp)
bmds->bulk_completed = 0;
bmds->total_sectors = sectors;
bmds->completed_sectors = 0;
bmds->shared_base = migrate_block_incremental();
assert(i < num_bs);
bmds_bs[i].bmds = bmds;

View file

@ -332,10 +332,6 @@ void hmp_info_migrate_parameters(Monitor *mon, const QDict *qdict)
monitor_printf(mon, "%s: %u ms\n",
MigrationParameter_str(MIGRATION_PARAMETER_X_CHECKPOINT_DELAY),
params->x_checkpoint_delay);
assert(params->has_block_incremental);
monitor_printf(mon, "%s: %s\n",
MigrationParameter_str(MIGRATION_PARAMETER_BLOCK_INCREMENTAL),
params->block_incremental ? "on" : "off");
monitor_printf(mon, "%s: %u\n",
MigrationParameter_str(MIGRATION_PARAMETER_MULTIFD_CHANNELS),
params->multifd_channels);
@ -616,10 +612,6 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict)
p->has_x_checkpoint_delay = true;
visit_type_uint32(v, param, &p->x_checkpoint_delay, &err);
break;
case MIGRATION_PARAMETER_BLOCK_INCREMENTAL:
p->has_block_incremental = true;
visit_type_bool(v, param, &p->block_incremental, &err);
break;
case MIGRATION_PARAMETER_MULTIFD_CHANNELS:
p->has_multifd_channels = true;
visit_type_uint8(v, param, &p->multifd_channels, &err);
@ -767,18 +759,12 @@ 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 inc = qdict_get_try_bool(qdict, "inc", 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 (inc) {
warn_report("option '-i' is deprecated;"
" use blockdev-mirror with NBD instead");
}
if (blk) {
warn_report("option '-b' is deprecated;"
" use blockdev-mirror with NBD instead");
@ -790,8 +776,8 @@ void hmp_migrate(Monitor *mon, const QDict *qdict)
}
QAPI_LIST_PREPEND(caps, g_steal_pointer(&channel));
qmp_migrate(NULL, true, caps, !!blk, blk, !!inc, inc,
false, false, true, resume, &err);
qmp_migrate(NULL, true, caps, !!blk, blk, false, false,
true, resume, &err);
if (hmp_handle_error(mon, err)) {
return;
}

View file

@ -1935,14 +1935,9 @@ 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 blk_inc,
bool resume, Error **errp)
static bool migrate_prepare(MigrationState *s, bool blk, bool resume,
Error **errp)
{
if (blk_inc) {
warn_report("parameter 'inc' is deprecated;"
" use blockdev-mirror with NBD instead");
}
if (blk) {
warn_report("parameter 'blk' is deprecated;"
" use blockdev-mirror with NBD instead");
@ -2032,12 +2027,12 @@ static bool migrate_prepare(MigrationState *s, bool blk, bool blk_inc,
}
}
if (blk || blk_inc) {
if (blk) {
if (migrate_colo()) {
error_setg(errp, "No disk migration is required in COLO mode");
return false;
}
if (migrate_block() || migrate_block_incremental()) {
if (migrate_block()) {
error_setg(errp, "Command options are incompatible with "
"current migration capabilities");
return false;
@ -2048,10 +2043,6 @@ static bool migrate_prepare(MigrationState *s, bool blk, bool blk_inc,
s->must_remove_block_options = true;
}
if (blk_inc) {
migrate_set_block_incremental(true);
}
if (migrate_init(s, errp)) {
return false;
}
@ -2061,8 +2052,8 @@ static bool migrate_prepare(MigrationState *s, bool blk, bool blk_inc,
void qmp_migrate(const char *uri, bool has_channels,
MigrationChannelList *channels, bool has_blk, bool blk,
bool has_inc, bool inc, bool has_detach, bool detach,
bool has_resume, bool resume, Error **errp)
bool has_detach, bool detach, bool has_resume, bool resume,
Error **errp)
{
bool resume_requested;
Error *local_err = NULL;
@ -2101,8 +2092,7 @@ void qmp_migrate(const char *uri, bool has_channels,
}
resume_requested = has_resume && resume;
if (!migrate_prepare(s, has_blk && blk, has_inc && inc,
resume_requested, errp)) {
if (!migrate_prepare(s, has_blk && blk, resume_requested, errp)) {
/* Error detected, put into errp */
return;
}

View file

@ -486,7 +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, inc/-i) "
error_setg(errp, "QEMU compiled without old-style (blk/-b) "
"block migration");
error_append_hint(errp, "Use blockdev-mirror with NBD instead.\n");
return false;
@ -763,13 +763,6 @@ bool migrate_has_block_bitmap_mapping(void)
return s->parameters.has_block_bitmap_mapping;
}
bool migrate_block_incremental(void)
{
MigrationState *s = migrate_get_current();
return s->parameters.block_incremental;
}
uint32_t migrate_checkpoint_delay(void)
{
MigrationState *s = migrate_get_current();
@ -948,15 +941,6 @@ ZeroPageDetection migrate_zero_page_detection(void)
return s->parameters.zero_page_detection;
}
/* parameter setters */
void migrate_set_block_incremental(bool value)
{
MigrationState *s = migrate_get_current();
s->parameters.block_incremental = value;
}
/* parameters helpers */
void block_cleanup_parameters(void)
@ -966,7 +950,6 @@ void block_cleanup_parameters(void)
if (s->must_remove_block_options) {
/* setting to false can never fail */
migrate_cap_set(MIGRATION_CAPABILITY_BLOCK, false, &error_abort);
migrate_set_block_incremental(false);
s->must_remove_block_options = false;
}
}
@ -1020,8 +1003,6 @@ MigrationParameters *qmp_query_migrate_parameters(Error **errp)
params->downtime_limit = s->parameters.downtime_limit;
params->has_x_checkpoint_delay = true;
params->x_checkpoint_delay = s->parameters.x_checkpoint_delay;
params->has_block_incremental = true;
params->block_incremental = s->parameters.block_incremental;
params->has_multifd_channels = true;
params->multifd_channels = s->parameters.multifd_channels;
params->has_multifd_compression = true;
@ -1081,7 +1062,6 @@ void migrate_params_init(MigrationParameters *params)
params->has_max_bandwidth = true;
params->has_downtime_limit = true;
params->has_x_checkpoint_delay = true;
params->has_block_incremental = true;
params->has_multifd_channels = true;
params->has_multifd_compression = true;
params->has_multifd_zlib_level = true;
@ -1359,9 +1339,6 @@ static void migrate_params_test_apply(MigrateSetParameters *params,
dest->x_checkpoint_delay = params->x_checkpoint_delay;
}
if (params->has_block_incremental) {
dest->block_incremental = params->block_incremental;
}
if (params->has_multifd_channels) {
dest->multifd_channels = params->multifd_channels;
}
@ -1502,11 +1479,6 @@ static void migrate_params_apply(MigrateSetParameters *params, Error **errp)
colo_checkpoint_delay_set();
}
if (params->has_block_incremental) {
warn_report("block migration is deprecated;"
" use blockdev-mirror with NBD instead");
s->parameters.block_incremental = params->block_incremental;
}
if (params->has_multifd_channels) {
s->parameters.multifd_channels = params->multifd_channels;
}

View file

@ -67,7 +67,6 @@ bool migrate_cap_set(int cap, bool value, Error **errp);
const BitmapMigrationNodeAliasList *migrate_block_bitmap_mapping(void);
bool migrate_has_block_bitmap_mapping(void);
bool migrate_block_incremental(void);
uint32_t migrate_checkpoint_delay(void);
int migrate_compress_level(void);
int migrate_compress_threads(void);
@ -92,10 +91,6 @@ const char *migrate_tls_hostname(void);
uint64_t migrate_xbzrle_cache_size(void);
ZeroPageDetection migrate_zero_page_detection(void);
/* parameters setters */
void migrate_set_block_incremental(bool value);
/* parameters helpers */
bool migrate_params_check(MigrationParameters *params, Error **errp);