From: Fabiano Rosas <farosas@suse.de>
To: Peter Xu <peterx@redhat.com>
Cc: qemu-devel@nongnu.org, "Markus Armbruster" <armbru@redhat.com>,
"Daniel P . Berrangé" <berrange@redhat.com>
Subject: Re: [PATCH 19/21] migration: Allow migrate commands to provide the migration config
Date: Tue, 10 Jun 2025 17:55:31 -0300 [thread overview]
Message-ID: <87jz5juxj0.fsf@suse.de> (raw)
In-Reply-To: <aEdFgjAAuagXUyT9@x1.local>
Peter Xu <peterx@redhat.com> writes:
> On Mon, Jun 09, 2025 at 04:41:06PM -0300, Fabiano Rosas wrote:
>> Peter Xu <peterx@redhat.com> writes:
>>
>> > On Mon, Jun 09, 2025 at 03:02:06PM -0300, Fabiano Rosas wrote:
>> >> Peter Xu <peterx@redhat.com> writes:
>> >>
>> >> > On Mon, Jun 09, 2025 at 11:37:02AM -0300, Fabiano Rosas wrote:
>> >> >> Peter Xu <peterx@redhat.com> writes:
>> >> >>
>> >> >> > On Fri, Jun 06, 2025 at 05:23:18PM -0300, Fabiano Rosas wrote:
>> >> >> >> Peter Xu <peterx@redhat.com> writes:
>> >> >> >>
>> >> >> >> > 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)
>> >> >> >> >
>> >> >> >> > Could we still keep the QMP migrate-set-parameters values?
>> >> >> >> >
>> >> >> >> > 'config' argument > QMP setups using migrate-set-parameters >
>> >> >> >> > -global cmdline > defaults (migration_properties)
>> >> >> >> >
>> >> >> >>
>> >> >> >> That's the case. I failed to mention it in the commit message. IOW it
>> >> >> >> behaves just like today, but the new 'config' way takes precedence over
>> >> >> >> all.
>> >> >> >
>> >> >> > Referring to below chunk of code:
>> >> >> >
>> >> >> > [...]
>> >> >> >
>> >> >> >> >> +bool migrate_params_override(MigrationState *s, MigrationParameters *new,
>> >> >> >> >> + Error **errp)
>> >> >> >> >> +{
>> >> >> >> >> + ERRP_GUARD();
>> >> >> >> >> +
>> >> >> >> >> + assert(bql_locked());
>> >> >> >> >> +
>> >> >> >> >> + /* reset to default parameters */
>> >> >> >> >> + migrate_params_apply(&s->defaults);
>> >> >> >
>> >> >> > IIUC here it'll reset all global parameters using the initial defaults
>> >> >> > first, then apply the "config" specified in "migrate" QMP command?
>> >> >> >
>> >> >>
>> >> >> Yes, this is so any previously set parameter via migrate-set-parameter
>> >> >> gets erased. I think what we want (but feel free to disagree) is to have
>> >> >> the migrate-set-parameter _eventually_ only handle parameters that need
>> >> >> to be modifed during migration runtime. Anything else can be done via
>> >> >> passing config to qmp_migrate.
>> >> >>
>> >> >> For -global, I don't have a preference. Having -global take precedence
>> >> >> over all would require a way to know which options were present in the
>> >> >> command-line and which are just the defaults seet in
>> >> >> migration_properties. I currently don't know how to do that. If it is at
>> >> >> all possible (within reason) we could make the change, no worries.
>> >> >>
>> >> >> > I think there're actually two separate questions to be asked, to make it
>> >> >> > clearer, they are:
>> >> >>
>> >> >> Here it got ambiguous when you say "global", I've been using -global to
>> >> >> refer to the cmdline -global migration.foo, but others have used global
>> >> >> to mean s->parameters (which has an extended lifetime). Could you
>> >> >> clarify?
>> >> >
>> >> > I meant the -global, and the global setups via migrate-set-parameters.
>> >> >
>> >> > As replied to Dan in the other email, I changed my mind on question (1); I
>> >> > think it makes sense to have it YES. I left my pure question on (2) there
>> >> > too.
>> >> >
>> >> > Do we really want to disable migrate-set-parameters setting most of the
>> >> > parameters, and only allow it to be set during migration on a few things
>> >> > like bandwidth or so?
>> >> >
>> >>
>> >> Well, if we decide we have reasons to introduce the "config" concept,
>> >> then I think we should not present two ways of doing the same
>> >> thing. User calls qmp_migrate with its arguments and that's the
>> >> migration. No other ways of setting parameters.
>> >>
>> >> Since we do have parameters that are set in "runtime" I though of
>> >> keeping migrate-set-parameters around to minimize the interface
>> >> change. Maybe those should have been separate knobs on their own after
>> >> all... But in any case, we can't reject migrate-set-parameters because
>> >> it might happen way earlier than the actual migration command. So I
>> >> don't think anything changes regarding the API.
>> >>
>> >> > I just don't really see the major benefit of that yet. I would think it
>> >> > make more sense if we don't need to change any parameters in migration,
>> >> > then provide that in one shot in QMP migrate "config". Maybe making more
>> >> > sense if migration is not heavily thread-based but having its aiocontext so
>> >> > we could even move to Jobs.
>> >> >
>> >> > Now after all we'll need to allow setting something like bandwidth even
>> >> > during migration alive, and we have all the things ready allowing to set
>> >> > before migration starts, I'm not 100% sure whether we need to bother even
>> >> > if it does look cleaner, because we'll still break mgmt used to be working
>> >> > for years.. I could be over-cautious on breaking things, but I still want
>> >> > to understand better on the benefits.
>> >> >
>> >>
>> >> Makes sense. We'd say either use the old way or the new way. If both are
>> >> mixed, then the new way takes precedence. That keeps older apps working
>> >> and allows new code to transition into the new way.
>> >
>> > Fair enough. Yes whenever the new way is chosen it can work in anyway we
>> > define it.
>> >
>> > It's just that if the global list of parameters will still be around then
>> > it seems to have no good reason to not build the migration parameters on
>> > top of the global list of parameters. After all, anything can be
>> > overwritten in the QMP migrate if needed.
>> >
>>
>> If we had a way to detect that the user has modified some parameters via
>> the cmdline, then we could merge that with the s->defaults and restore
>> it before applying config, that would achieve what you want. I'm in
>> favor, -global should only be used for debugging, I think it's fine if
>> we let it go through. But anything set by migrate-set-parameters
>> definitely needs to be reset. I just need a way to differentiate between
>> "default parameter" vs. "default parameter that got overwritten by
>> -global". I'll try to figure something out.
>
> I think I see what you meant. Ignoring -global is ok. I agree with you
> that should be pure debugging, and feel free to keep it like that if you
> can't find anything to persist it - it may not justify your time spent if
> it grows too much.
>
I think I caused some confusion here. I wrote migrate_params_override()
last thing on a friday and forgot it did the right thing from the
beginning:
migrate_params_apply(&s->defaults);
qmp_migrate_set_parameters(new, errp);
This s->defaults is poorly named and is actualy already the merge of
defaults + globals, because qdev does it for us. migrate_params_apply()
will then copy that to s->parameters and qmp_migrate_set_parameters()
will apply the 'new' params from 'config' on top s->parameters. An
example:
Setting multifd-channels (default 2) using various methods and querying
both QMP and HMP:
a) global overrides default:
$ ./qemu-system-x86_64 -global migration.multifd-channels=4 ...
=> QMP: "multifd-channels": 4, HMP: multifd-channels: 4
b) migrate-set-parameter overrides global:
{ 'execute': 'migrate-set-parameters', 'arguments': { 'multifd-channels': 8 } }
=> QMP: "multifd-channels": 8, HMP: multifd-channels: 8
c) config not touching the parameter, value is reset to global:
{ 'execute': 'migrate', 'arguments': { ..., 'config': { 'multifd': true } } }
=> QMP: "multifd-channels": 4, HMP: multifd-channels: 4
d) config overrides all:
{ 'execute': 'migrate', 'arguments': { ..., 'config': {'multifd-channels': 16 } } }
=> QMP: "multifd-channels": 16, HMP: multifd-channels: 16
Without global:
e) default is set initially
$ ./qemu-system-x86_64 ...
=> QMP: "multifd-channels": 2, HMP: multifd-channels: 2
f) migrate-set-parameter overrides default:
{ 'execute': 'migrate-set-parameters', 'arguments': { 'multifd-channels': 8 } }
=> QMP: "multifd-channels": 8, HMP: multifd-channels: 8
g) config not touching the parameter, value is reset to default:
{ 'execute': 'migrate', 'arguments': { ..., 'config': { 'multifd': true } } }
=> "multifd-channels": 2, HMP: multifd-channels: 2
h) config overrides all:
{ 'execute': 'migrate', 'arguments': { ..., 'config': {'multifd-channels': 16 } } }
=> QMP: "multifd-channels": 16, HMP: multifd-channels: 16
I'll update the variable names and code comments to be more
precise. Sorry for the noise.
next prev parent reply other threads:[~2025-06-10 20:56 UTC|newest]
Thread overview: 83+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-03 1:37 [PATCH 00/21] migration: Unify capabilities and parameters Fabiano Rosas
2025-06-03 1:37 ` [PATCH 01/21] migration: Normalize tls arguments Fabiano Rosas
2025-06-05 20:51 ` Peter Xu
2025-06-06 13:48 ` Fabiano Rosas
2025-06-25 9:41 ` Markus Armbruster
2025-06-25 17:17 ` Fabiano Rosas
2025-06-26 9:38 ` Markus Armbruster
2025-06-26 14:51 ` Fabiano Rosas
2025-06-27 7:10 ` Markus Armbruster
2025-06-27 20:28 ` Fabiano Rosas
2025-07-01 7:08 ` Markus Armbruster
2025-07-01 9:05 ` Daniel P. Berrangé
2025-06-03 1:37 ` [PATCH 02/21] migration: Remove MigrateSetParameters Fabiano Rosas
2025-06-05 20:58 ` Peter Xu
2025-06-25 11:31 ` Markus Armbruster
2025-06-25 17:21 ` Fabiano Rosas
2025-06-26 9:40 ` Markus Armbruster
2025-06-03 1:37 ` [PATCH 03/21] qapi/migration: Don't document MigrationParameter Fabiano Rosas
2025-06-05 21:00 ` Peter Xu
2025-06-25 12:04 ` Markus Armbruster
2025-06-25 12:22 ` Markus Armbruster
2025-06-25 17:29 ` Fabiano Rosas
2025-06-03 1:37 ` [PATCH 04/21] migration: Run a post update routine after setting parameters Fabiano Rosas
2025-06-03 1:37 ` [PATCH 05/21] migration: Add a flag to track block-bitmap-mapping input Fabiano Rosas
2025-06-06 15:03 ` Peter Xu
2025-06-06 15:43 ` Fabiano Rosas
2025-06-06 17:44 ` Peter Xu
2025-06-06 18:38 ` Fabiano Rosas
2025-06-03 1:37 ` [PATCH 06/21] migration: Remove checks for s->parameters has_* fields Fabiano Rosas
2025-06-06 15:13 ` Peter Xu
2025-06-03 1:37 ` [PATCH 07/21] migration: Set block_bitmap_mapping unconditionally in query-migrate-parameters Fabiano Rosas
2025-06-03 1:37 ` [PATCH 08/21] migration: Do away with usage of QERR_INVALID_PARAMETER_VALUE Fabiano Rosas
2025-06-06 15:17 ` Peter Xu
2025-06-03 1:37 ` [PATCH 09/21] migration: Extract code to mark all parameters as present Fabiano Rosas
2025-06-06 15:26 ` Peter Xu
2025-06-06 15:51 ` Fabiano Rosas
2025-06-06 17:48 ` Peter Xu
2025-06-03 1:37 ` [PATCH 10/21] migration: Use QAPI_CLONE_MEMBERS in query_migrate_parameters Fabiano Rosas
2025-06-06 15:29 ` Peter Xu
2025-06-06 15:53 ` Fabiano Rosas
2025-06-12 20:58 ` Fabiano Rosas
2025-06-12 21:27 ` Peter Xu
2025-06-13 12:30 ` Fabiano Rosas
2025-06-03 1:38 ` [PATCH 11/21] migration: Use QAPI_CLONE_MEMBERS in migrate_params_test_apply Fabiano Rosas
2025-06-03 1:38 ` [PATCH 12/21] migration: Use QAPI_CLONE_MEMBERS in migrate_params_apply Fabiano Rosas
2025-06-03 1:38 ` [PATCH 13/21] migration: Use visitors in migrate_params_test_apply Fabiano Rosas
2025-06-03 1:38 ` [PATCH 14/21] migration: Cleanup hmp_info_migrate_parameters Fabiano Rosas
2025-06-06 18:52 ` Peter Xu
2025-06-03 1:38 ` [PATCH 15/21] migration: Add capabilities into MigrationParameters Fabiano Rosas
2025-06-06 19:01 ` Peter Xu
2025-06-03 1:38 ` [PATCH 16/21] qapi/migration: Mark that query/set-migrate-parameters support capabilities Fabiano Rosas
2025-06-03 9:01 ` Daniel P. Berrangé
2025-06-06 13:53 ` Fabiano Rosas
2025-06-03 1:38 ` [PATCH 17/21] migration: Remove s->capabilities Fabiano Rosas
2025-06-06 19:16 ` Peter Xu
2025-06-03 1:38 ` [PATCH 18/21] qapi/migration: Deprecate capabilities commands Fabiano Rosas
2025-06-06 19:16 ` Peter Xu
2025-06-03 1:38 ` [PATCH 19/21] migration: Allow migrate commands to provide the migration config Fabiano Rosas
2025-06-03 9:03 ` Daniel P. Berrangé
2025-06-06 19:28 ` Peter Xu
2025-06-06 20:23 ` Fabiano Rosas
2025-06-06 20:50 ` Peter Xu
2025-06-09 14:37 ` Fabiano Rosas
2025-06-09 15:51 ` Peter Xu
2025-06-09 16:13 ` Daniel P. Berrangé
2025-06-09 16:49 ` Peter Xu
2025-06-09 18:17 ` Fabiano Rosas
2025-06-09 18:02 ` Fabiano Rosas
2025-06-09 19:05 ` Peter Xu
2025-06-09 19:41 ` Fabiano Rosas
2025-06-09 20:35 ` Peter Xu
2025-06-10 20:55 ` Fabiano Rosas [this message]
2025-06-10 21:27 ` Peter Xu
2025-06-09 15:03 ` Daniel P. Berrangé
2025-06-09 15:33 ` Peter Xu
2025-06-09 15:43 ` Daniel P. Berrangé
2025-06-09 15:53 ` Peter Xu
2025-06-09 15:58 ` Peter Xu
2025-06-09 16:15 ` Daniel P. Berrangé
2025-06-09 16:41 ` Peter Xu
2025-06-03 1:38 ` [PATCH 20/21] libqtest: Add a function to check whether a QMP command supports a feature Fabiano Rosas
2025-06-03 1:38 ` [PATCH 21/21] tests/qtest/migration: Add a test for config passing Fabiano Rosas
2025-06-12 6:41 ` [PATCH 00/21] migration: Unify capabilities and parameters Mario Casquero
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=87jz5juxj0.fsf@suse.de \
--to=farosas@suse.de \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--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.