From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Fabiano Rosas <farosas@suse.de>,
qemu-devel@nongnu.org, Peter Xu <peterx@redhat.com>
Subject: Re: [PATCH 01/21] migration: Normalize tls arguments
Date: Tue, 1 Jul 2025 10:05:10 +0100 [thread overview]
Message-ID: <aGOkxrIpbi-tWB25@redhat.com> (raw)
In-Reply-To: <8734bg4cde.fsf@pond.sub.org>
On Tue, Jul 01, 2025 at 09:08:13AM +0200, Markus Armbruster wrote:
> Fabiano Rosas <farosas@suse.de> writes:
>
> > Markus Armbruster <armbru@redhat.com> writes:
> >
> >> Fabiano Rosas <farosas@suse.de> writes:
> >>
> >>> Markus Armbruster <armbru@redhat.com> writes:
> >>>
> >>>> Fabiano Rosas <farosas@suse.de> writes:
> >>>>
> >>>>> Markus Armbruster <armbru@redhat.com> writes:
> >>>>>
> >>>>>> Fabiano Rosas <farosas@suse.de> writes:
>
> [...]
>
> >> There more than one way to skin this cat. I like to keep state
> >> normalized.
> >>
> >> State is an optional StrOrNull. Possible values:
> >>
> >> * NULL
> >>
> >> * QNull, i.e. non-NULL, ->type is QTYPE_QNULL
> >>
> >> * Empty string, i.e. non-NULL, ->type is QTYPE_QSTRING, ->u.s is ""
> >>
> >> * Non-empty string, i.e. non-NULL, -> type is QTYPE_QSTRING, ->u.s is
> >> not "" (and cannot be NULL)
> >>
> >> As far as I understand, we have just two cases semantically:
> >>
> >> * Set, value is a non-empty string (empty makes no sense)
> >>
> >> * Unset
> >>
> >> I'd normalize the state to "either NULL, or (non-empty) string".
> >>
> >
> > This is what I wanted to do (in the next version), but it results in
> > more complex and less readable code:
>
> [...]
>
> > If we instead normalize to "either non-empty string or empty string"
> > then:
>
> [...]
>
> > The query methods get simpler because s->parameters already contains
> > data in the format they expect, we can normalize earlier in [2], which
> > means data is always in the same format throughout
> > qmp_migrate_set_parameters() and lastly, we already have the getter
> > methods [1] which can expose "abc"|NULL to the rest of the code anyway.
>
> I'd like the possible states to be clearly visible, and suggest to guard
> them with assertions. Details, such as how exactly the states are
> encoded, are up to you. You're in a better position to judge them than
> I am.
>
> >> When writing state, we need to normalize.
> >>
> >> When reading state, we can rely on it being normalized. Asserting it is
> >> seems prudent, and should help readers.
> >>
> >
> > My main concern is that reading can rely on it being normalized, but the
> > query methods cannot, so they need to do an "extra conversion", which
> > from the reader's POV, will look nonsensical. It's not as simple as
> > using a ternary because the StrOrNull object needs to be allocated.
>
> [...]
>
> >>> There are two external interfaces actually.
> >>>
> >>> -global migration.some_compat_option=on (stored in MigrationState):
> >>>
> >>> seems intentional and I believe we'd lose the ability to get out of some
> >>> tricky situations if we ditched it.
> >>>
> >>> -global migation.some_random_option=on (stored in MigrationParameters):
> >>>
> >>> has become a debugging *feature*, which I personally don't use, but
> >>> others do. And worse: we don't know if anyone uses it in production.
> >>
> >> Accidental external interface.
> >>
> >>> We also arbitrarily put x- in front of options for some reason. There is
> >>> an argument to drop those because x- is scary and no one should be using
> >>> them.
> >>
> >> We pretty much ditched the x- convention in the QAPI schema.
> >> docs/devel/qapi-code-gen.rst:
> >>
> >> Names beginning with ``x-`` used to signify "experimental". This
> >> convention has been replaced by special feature "unstable".
> >>
> >> Goes back to
> >>
> >> commit a3c45b3e62962f99338716b1347cfb0d427cea44
> >> Author: Markus Armbruster <armbru@redhat.com>
> >> Date: Thu Oct 28 12:25:12 2021 +0200
> >>
> >> qapi: New special feature flag "unstable"
> >>
> >> By convention, names starting with "x-" are experimental. The parts
> >> of external interfaces so named may be withdrawn or changed
> >> incompatibly in future releases.
> >
> > This allows dropping about half of the parameters we expose. Deprecate
> > the other half, move the remaining legitimate compat options into
> > MigrationParameters, (which can be set by migrate-set-parameters) and
> > maybe we can remove the TYPE_DEVICE from MigrationState anytime this
> > decade.
>
> I'd love to get rid of the pseudo-device.
>
> > Moving all qdev properties to their own TYPE_DEVICE object and putting
> > it under --enable-debug is also an idea.
> >
> > I'm willing to do the work if we ever reach a consensus about this.
>
> I'd like migration to work more like other long-running tasks: pass the
> entire configuration with the command starting it, provide commands and
> events to manage the task while it runs.
>
> This is advice, not a demand. I'm not going to block change the
> migration maintainers want. I may ask you to do the QAPI schema part in
> certain ways, but that's detail.
This should be doable as IIUC at the end of this series, the QMP
'migrate-incoming' command parameters can express all the required
data for accepting an incoming migration. As such, that parameter
struct could be exposed on the CLI with the CLI json syntax to
accept complex args in a way that wasn't possible historically
with -incoming.
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 :|
next prev parent reply other threads:[~2025-07-01 9:13 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é [this message]
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
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=aGOkxrIpbi-tWB25@redhat.com \
--to=berrange@redhat.com \
--cc=armbru@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).