mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
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:
parent
61c4e39f73
commit
18d154f575
13 changed files with 25 additions and 300 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue