On Mon, Jun 02, 2025 at 10:38:08PM -0300, Fabiano Rosas wrote:
> Allow the migrate and migrate_incoming commands to pass the migration
> configuration options all at once, dispensing the use of
> migrate-set-parameters and migrate-set-capabilities.
> 
> The motivation of this is to simplify the interface with the
> management layer and avoid the usage of several command invocations to
> configure a migration. It also avoids stale parameters from a previous
> migration to influence the current migration.
> 
> The options that are changed during the migration can still be set
> with the existing commands.
> 
> The order of precedence is:
> 
> 'config' argument > -global cmdline > defaults (migration_properties)
> 
> I.e. the config takes precedence over all, values not present in the
> config assume the default values. The (debug) -global command line
> option allows the defaults to be overridden.
> 
> Signed-off-by: Fabiano Rosas <faro...@suse.de>
> ---
>  migration/migration-hmp-cmds.c |  5 +++--
>  migration/migration.c          | 29 ++++++++++++++++++++++++++---
>  migration/migration.h          |  1 +
>  migration/options.c            | 30 ++++++++++++++++++++++++++++++
>  migration/options.h            |  3 +++
>  qapi/migration.json            | 25 +++++++++++++++++++++++--
>  system/vl.c                    |  3 ++-
>  7 files changed, 88 insertions(+), 8 deletions(-)

> diff --git a/qapi/migration.json b/qapi/migration.json
> index 7282e4b9eb..64a92d8d28 100644
> --- a/qapi/migration.json
> +++ b/qapi/migration.json
> @@ -1474,9 +1474,16 @@
>  #
>  # @resume: resume one paused migration, default "off".  (since 3.0)
>  #
> +# @config: migration configuration options, previously set via
> +#     @migrate-set-parameters and @migrate-set-capabilities.  (since
> +#     10.1)
> +#
>  # Features:
>  #
>  # @deprecated: Argument @detach is deprecated.
> +# @config: Indicates this command can receive the entire migration
> +# configuration via the @config field, dispensing the use of
> +# @migrate-set-parameters.

There is no need to add this feature - mgmt apps can identify
this simply by the fact that the 'config' parameter now exists
in the QAPI schema.

>  #
>  # Since: 0.14
>  #
> @@ -1538,7 +1545,9 @@
>    'data': {'*uri': 'str',
>             '*channels': [ 'MigrationChannel' ],
>             '*detach': { 'type': 'bool', 'features': [ 'deprecated' ] },
> -           '*resume': 'bool' } }
> +           '*config': 'MigrationParameters',
> +           '*resume': 'bool' },
> +  'features': [ 'config' ] }
>  
>  ##
>  # @migrate-incoming:
> @@ -1557,6 +1566,16 @@
>  #     error details could be retrieved with query-migrate.
>  #     (since 9.1)
>  #
> +# @config: migration configuration options, previously set via
> +#     @migrate-set-parameters and @migrate-set-capabilities.  (since
> +#     10.1)
> +#
> +# Features:
> +#
> +# @config: Indicates this command can receive the entire migration
> +# configuration via the @config field, dispensing the use of
> +# @migrate-set-parameters.

Likewise redundant.

> +#
>  # Since: 2.3
>  #
>  # .. admonition:: Notes
> @@ -1610,7 +1629,9 @@
>  { 'command': 'migrate-incoming',
>               'data': {'*uri': 'str',
>                        '*channels': [ 'MigrationChannel' ],
> -                      '*exit-on-error': 'bool' } }
> +                      '*config': 'MigrationParameters',
> +                      '*exit-on-error': 'bool' },
> +             'features': [ 'config' ] }
>  
>  ##
>  # @xen-save-devices-state:

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|


Reply via email to