[PATCH v4 03/10] migration: migrate 'inc' command option is deprecated.
Markus Armbruster
armbru at redhat.com
Fri Oct 13 13:09:23 UTC 2023
Juan Quintela <quintela at redhat.com> writes:
> Set the 'block_incremental' migration parameter to 'true' instead.
>
> Reviewed-by: Thomas Huth <thuth at redhat.com>
> Acked-by: Stefan Hajnoczi <stefanha at redhat.com>
> Signed-off-by: Juan Quintela <quintela at redhat.com>
>
> ---
>
> Improve documentation and style (thanks Markus)
> ---
> docs/about/deprecated.rst | 7 +++++++
> qapi/migration.json | 8 +++++++-
> migration/migration.c | 6 ++++++
> 3 files changed, 20 insertions(+), 1 deletion(-)
>
> diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
> index 1c4d7f36f0..1b6b2870cf 100644
> --- a/docs/about/deprecated.rst
> +++ b/docs/about/deprecated.rst
> @@ -452,3 +452,10 @@ Migration
> ``skipped`` field in Migration stats has been deprecated. It hasn't
> been used for more than 10 years.
>
> +``inc`` migrate command option (since 8.2)
> +''''''''''''''''''''''''''''''''''''''''''
> +
> +The new way to modify migration is using migration parameters.
> +``inc`` functionality can be achieved by setting the
> +``block-incremental`` migration parameter to ``true``.
> +
> diff --git a/qapi/migration.json b/qapi/migration.json
> index 6865fea3c5..56bbd55b87 100644
> --- a/qapi/migration.json
> +++ b/qapi/migration.json
> @@ -1492,6 +1492,11 @@
> #
> # @resume: resume one paused migration, default "off". (since 3.0)
> #
> +# Features:
> +#
> +# @deprecated: Member @inc is deprecated. Use migration parameter
> +# @block-incremental instead.
This is fine now. It becomes bad advice in PATCH 05, which deprecates
@block-incremental. Two solutions:
1. Change this patch to point to an alternative that will *not* be
deprecated.
2. Change PATCH 05.
Same end result.
> +#
> # Returns: nothing on success
> #
> # Since: 0.14
> @@ -1513,7 +1518,8 @@
> # <- { "return": {} }
> ##
> { 'command': 'migrate',
> - 'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool',
> + 'data': {'uri': 'str', '*blk': 'bool',
> + '*inc': { 'type': 'bool', 'features': [ 'deprecated' ] },
> '*detach': 'bool', '*resume': 'bool' } }
>
> ##
> diff --git a/migration/migration.c b/migration/migration.c
> index 1c6c81ad49..ac4897fe0d 100644
> --- a/migration/migration.c
> +++ b/migration/migration.c
> @@ -1601,6 +1601,12 @@ static bool migrate_prepare(MigrationState *s, bool blk, bool blk_inc,
> {
> Error *local_err = NULL;
>
> + if (blk_inc) {
> + warn_report("@inc/-i migrate option is deprecated, set the"
This is either about QMP migrate's parameter "inc", or HMP migrate's
flags -i.
In the former case, we want something like "parameter 'inc' is
deprecated".
In the latter case, we want something like "-i is deprecated".
Trying to do both in a single message results in a sub-par message. If
you want to do better, you have to check in hmp_migrate(), too. Then
hmp_migrate can refer to "-i", and migrate_prepare() to "parameter
'inc'". Up to you.
If you decide a single message is good enough, use something like
"parameter 'inc' / flag -i is deprecated".
> + "'block-incremental' migration parameter to 'true'"
> + " instead.");
Again, fine now, becomes bad advice in PATCH 05.
> + }
> +
> if (resume) {
> if (s->state != MIGRATION_STATUS_POSTCOPY_PAUSED) {
> error_setg(errp, "Cannot resume if there is no "
More information about the libvir-list
mailing list