All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Fabiano Rosas <farosas@suse.de>
Cc: qemu-devel@nongnu.org, "Peter Xu" <peterx@redhat.com>,
	"Daniel P . Berrangé" <berrange@redhat.com>
Subject: Re: [RFC PATCH 12/13] [PoC] migration: Add query/set commands for MigrationConfig
Date: Mon, 26 May 2025 09:51:28 +0200	[thread overview]
Message-ID: <874ix7byin.fsf@pond.sub.org> (raw)
In-Reply-To: <20250411191443.22565-13-farosas@suse.de> (Fabiano Rosas's message of "Fri, 11 Apr 2025 16:14:42 -0300")

Fabiano Rosas <farosas@suse.de> writes:

> Add the QMP commands query-migrate-config and migrate-set-config to
> read and write the migration configuration options.

These supersede query-migrate-capabilities, query-migrate-parameters,
migrate-set-capabilities, and migrate-set-parameters, right?

> Signed-off-by: Fabiano Rosas <farosas@suse.de>
> ---
>  migration/options.c | 24 ++++++++++++++++++++++++
>  migration/options.h |  2 +-
>  qapi/migration.json | 42 ++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 67 insertions(+), 1 deletion(-)
>
> diff --git a/migration/options.c b/migration/options.c
> index 4e3792dec3..c85ee2e506 100644
> --- a/migration/options.c
> +++ b/migration/options.c
> @@ -1441,3 +1441,27 @@ void qmp_migrate_set_parameters(MigrateSetParameters *params, Error **errp)
>      migrate_config_apply(&tmp);
>      migrate_post_update_config(&tmp, errp);
>  }
> +
> +void qmp_migrate_set_config(MigrationConfig *config, Error **errp)
> +{
> +    if (!migrate_config_check(config, errp)) {
> +        /* Invalid parameter */
> +        return;
> +    }
> +
> +    migrate_config_apply(config);
> +    migrate_post_update_config(config, errp);
> +}
> +
> +MigrationConfig *qmp_query_migrate_config(Error **errp)
> +{
> +    MigrationState *s = migrate_get_current();
> +    MigrationConfig *config = g_new0(MigrationConfig, 1);
> +
> +    QAPI_CLONE_MEMBERS(MigrationConfig, config, &s->config);
> +
> +    /* set the has_* fields for every option */
> +    migrate_config_init(config);
> +
> +    return config;
> +}
> diff --git a/migration/options.h b/migration/options.h
> index 61ee854bb0..0e36dafe80 100644
> --- a/migration/options.h
> +++ b/migration/options.h
> @@ -72,7 +72,7 @@ uint64_t migrate_xbzrle_cache_size(void);
>  ZeroPageDetection migrate_zero_page_detection(void);
>  
>  bool migrate_config_check(MigrationConfig *params, Error **errp);
> -void migrate_config_init(MigrationConfig *params);
> +void migrate_config_init(MigrationConfig *config);

Have you considered renaming the declaration's parameter when you change
its type in PATCH 08, or when you rename the definition's parameter in
PATCH 11?

>  bool migrate_config_get_cap_compat(MigrationConfig *config, int i);
>  bool migrate_caps_check(MigrationConfig *new, Error **errp);
>  #endif
> diff --git a/qapi/migration.json b/qapi/migration.json
> index 5e39f21adc..bb2487dbc6 100644
> --- a/qapi/migration.json
> +++ b/qapi/migration.json
> @@ -2552,3 +2552,45 @@
>    'data': { '*tls-creds': 'str',
>              '*tls-hostname': 'str',
>              '*tls-authz': 'str' } }
> +
> +##
> +# @query-migrate-config:
> +#
> +# Returns information about the current migration configuration
> +# options
> +#
> +# Returns: @MigrationConfig
> +#
> +# Since: 10.1
> +#
> +# .. qmp-example::
> +#
> +#     -> { "execute": "query-migrate-config" }
> +#     <- { "return": {
> +#              "multifd-channels": 2,
> +#              "cpu-throttle-increment": 10,
> +#              "cpu-throttle-initial": 20,
> +#              "max-bandwidth": 33554432,
> +#              "downtime-limit": 300
> +#           }
> +#        }
> +##
> +{ 'command': 'query-migrate-config',
> +  'returns': 'MigrationConfig' }
> +
> +##
> +# @migrate-set-config:
> +#
> +# Set various migration configuration options.
> +#
> +# Since: 10.1
> +#
> +# .. qmp-example::
> +#
> +#     -> { "execute": "migrate-set-config" ,
> +#          "arguments": { "max-bandwidth": 33554432,
> +#                         "downtime-limit": 300 } }
> +#     <- { "return": {} }
> +##
> +{ 'command': 'migrate-set-config', 'boxed': true,
> +  'data': 'MigrationConfig' }

This patch exposes MigrationConfig externally.  We should double-check
its documentation to make sure it's what we want there.  Known issue:
how to reset @tls-creds & friends.  Touched in my review of PATCH 07.



  reply	other threads:[~2025-05-26  7:52 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-11 19:14 [RFC PATCH 00/13] migration: Unify capabilities and parameters Fabiano Rosas
2025-04-11 19:14 ` [RFC PATCH 01/13] migration: Fix latent bug in migrate_params_test_apply() Fabiano Rosas
2025-04-11 19:14 ` [RFC PATCH 02/13] migration: Normalize tls arguments Fabiano Rosas
2025-04-14 16:30   ` Daniel P. Berrangé
2025-04-11 19:14 ` [RFC PATCH 03/13] migration: Run a post update routine after setting parameters Fabiano Rosas
2025-05-15 20:42   ` Peter Xu
2025-04-11 19:14 ` [RFC PATCH 04/13] migration: Fix parameter validation Fabiano Rosas
2025-05-15 20:59   ` Peter Xu
2025-05-22 16:39     ` Fabiano Rosas
2025-05-22 17:39       ` Fabiano Rosas
2025-05-26 13:09         ` Peter Xu
2025-05-26 15:41           ` Fabiano Rosas
2025-04-11 19:14 ` [RFC PATCH 05/13] migration: Reduce a bit of duplication in migration.json Fabiano Rosas
2025-04-14 16:38   ` Daniel P. Berrangé
2025-04-14 17:02     ` Fabiano Rosas
2025-04-16 13:38       ` Markus Armbruster
2025-04-16 14:41         ` Fabiano Rosas
2025-04-17  5:56           ` Markus Armbruster
2025-04-17 18:45   ` Markus Armbruster
2025-04-18  6:40     ` Markus Armbruster
2025-04-11 19:14 ` [RFC PATCH 06/13] migration: Remove the parameters copy during validation Fabiano Rosas
2025-04-11 19:14 ` [RFC PATCH 07/13] migration: Introduce new MigrationConfig structure Fabiano Rosas
2025-04-18  7:03   ` Markus Armbruster
2025-05-23 13:38     ` Fabiano Rosas
2025-05-26  7:37       ` Markus Armbruster
2025-04-11 19:14 ` [RFC PATCH 08/13] migration: Replace s->parameters with s->config Fabiano Rosas
2025-04-11 19:14 ` [RFC PATCH 09/13] migration: Do away with usage of QERR_INVALID_PARAMETER_VALUE Fabiano Rosas
2025-04-11 19:14 ` [RFC PATCH 10/13] migration: Replace s->capabilities with s->config Fabiano Rosas
2025-04-11 19:14 ` [RFC PATCH 11/13] migration: Merge parameters and capability checks Fabiano Rosas
2025-04-11 19:14 ` [RFC PATCH 12/13] [PoC] migration: Add query/set commands for MigrationConfig Fabiano Rosas
2025-05-26  7:51   ` Markus Armbruster [this message]
2025-05-27 22:14     ` Fabiano Rosas
2025-04-11 19:14 ` [RFC PATCH 13/13] [PoC] migration: Allow migrate commands to provide the migration config Fabiano Rosas
2025-05-26  8:03   ` Markus Armbruster
2025-05-26 15:10     ` Peter Xu
2025-04-14 16:44 ` [RFC PATCH 00/13] migration: Unify capabilities and parameters Daniel P. Berrangé
2025-04-14 17:12   ` Fabiano Rosas
2025-04-14 17:20     ` Daniel P. Berrangé
2025-04-14 17:40       ` Fabiano Rosas
2025-04-14 19:06         ` Daniel P. Berrangé
2025-05-15 20:21         ` Peter Xu
2025-04-16 13:44   ` Markus Armbruster
2025-04-16 15:00     ` Fabiano Rosas
2025-04-24  9:35       ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874ix7byin.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=farosas@suse.de \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.