From: Markus Armbruster <armbru@redhat.com>
To: Peter Xu <peterx@redhat.com>
Cc: qemu-devel@nongnu.org, "Juan Quintela" <quintela@redhat.com>,
"Fabiano Rosas" <farosas@suse.de>,
"Daniel P . Berrangé" <berrange@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Thomas Huth" <thuth@redhat.com>
Subject: Re: [PATCH v3 0/4] qapi/migration: Dedup migration parameter objects and fix tls-authz crash
Date: Tue, 17 Oct 2023 08:32:02 +0200 [thread overview]
Message-ID: <87v8b5dajh.fsf@pond.sub.org> (raw)
In-Reply-To: <ZS1k3mBVHgIPrjfO@x1n> (Peter Xu's message of "Mon, 16 Oct 2023 12:29:18 -0400")
Peter Xu <peterx@redhat.com> writes:
> On Mon, Oct 16, 2023 at 09:08:40AM +0200, Markus Armbruster wrote:
>> Let me try to summarize our findings so far.
>
> Thanks. I'll reply here instead of all the rest places.
>
>>
>> PATCH 1 has been merged. PATCH 2 has been queued, but not merged (not
>> sure why, accident?).
>
> (I don't know, either; could be in the next pull)
>
>>
>> The remaining two are the actual de-triplication:
>>
>> PATCH 3: Fuse MigrationParameters and MigrateSetParameters
>>
>> PATCH 4: De-document MigrationParameter
>>
>> The latter is a much simpler problem, so let's discuss it first.
>>
>>
>> Enum MigrationParameter is used only internally. It's in the QAPI
>> schema just because we want code generated for it. It shouldn't be
>> documented in the QEMU QMP Reference Manual, but is, because the
>> generator is too stupid to elide internal-only stuff.
>>
>> PATCH 4 moves it out of the schema. It has to add back the lost
>> generated code in hand-written form, which is a bit unfortunate. I
>> proposed to instead drop most of the useless doc comment by exploiting a
>> QAPI generator loophole.
>>
>> Aside: the QAPI generator should elide internal-only stuff from the QEMU
>> QMP Reference manual, and it should not require doc comments then.
>> Future work, let's not worry about it now.
>
> Just to double check: @MigrationParameter will not be exported in any form
> even today, including query-qmp-schema, am I right?
You are right.
Checking whether something is in the output of query-qmp-schema is easy:
look for it in the generated qapi-introspect.c. Command names appear
like
QLIT_QDICT(((QLitDictEntry[]) {
[...]
{ "meta-type", QLIT_QSTR("command"), },
{ "name", QLIT_QSTR("query-migrate"), },
[...]
})),
Events names appear like
QLIT_QDICT(((QLitDictEntry[]) {
[...]
{ "meta-type", QLIT_QSTR("event"), },
{ "name", QLIT_QSTR("MIGRATION"), },
[...]
})),
Type names appear in comments instead of code, like
/* "145" = MigrationParameters */
MigrationParameter does not appear.
>> The fusing of MigrationParameters and MigrateSetParameters is kind of
>> stuck. Several options, all with drawbacks or problems:
>>
>> 1. Pick StrOrNull for the tls_FOO members
>>
>> This is what PATCH 3 does. Blocked on the pre-existing class of
>> crash bugs discussed in
>>
>> Subject: QAPI string visitors crashes
>> Message-ID: <875y3epv3y.fsf@pond.sub.org>
>> https://lore.kernel.org/qemu-devel/875y3epv3y.fsf@pond.sub.org/
>>
>> Needs fixing, but when a fix will be available is unclear.
>>
>> 2. Pick str for the tls_FOO members
>>
>> This is what v1 did. Incompatible change: JSON null no longer works.
>> Libvirt doesn't use it (it uses deprecated "" instead), but we cannot
>> know for sure nothing else out there uses it.
>>
>> I don't think reducing development friction (that's what
>> de-duplication accomplishes) justifies breaking our compatibility
>> promise.
>>
>> To keep the promise, we'd have to deprecate null, un-deprecate "",
>> let the grace period pass, and only then de-duplicate.
>
> Is "" deprecated already anywhere?
Deprecation was cleary intended (see commit message of 01fa5598269), but
it looks like it wasn't (and isn't) properly documented. We were much
less organized about deprecating stuff back then.
>> 3. Do nothing, live with the duplication
>>
>> Giving up like this would be sad. Unless we commit to a more
>> complete overhaul of migration's QAPI/QMP configuration interface,
>> but I doubt we're ready for that.
>>
>> Thoughts?
>
> I already went 3) on the patch I posted for avail-switchover-bw. I don't
> know what's the best for 1) and 2), but if we can at least reduce
> duplication from 3->2 that's a progress. I replied in the other thread for
> that loophole experiment.
>
> How hard it is to mark an object not requiring documentation on each of its
> field, if that's what we want in this case? Currently the loophole didn't
> work for me for some reason. If we can have a marker for objects to escape
> doc check legally, we can apply that to both @MigrationParameter and one
> other (perhaps @MigrationSetParameters).
I can see two useful QAPI generator features:
* Improved handling of missing member documentation
Problem: many members lack documentation. We silently generate
documentation like
name-of-member
Not documented
for them.
Possible improvement: make missing member documentation a hard error,
create a knob to suppress the error for a type. Open question: how to
best document member documentation is incomplete.
* Suppress documentation for internal-only definitions
Problem: generated documentation covers everything, even types that
aren't visible in QMP. The irrelevant material is distracting and
possibly confusing for users, and may be bothersome to maintain for
developers.
Possible improvement: include only the types visible in QMP in
documentation, similar to how we do for query-qmp-schema. Open
question: what level of documentation to require for internal-only
types.
next prev parent reply other threads:[~2023-10-17 6:32 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-05 16:23 [PATCH v3 0/4] qapi/migration: Dedup migration parameter objects and fix tls-authz crash Peter Xu
2023-09-05 16:23 ` [PATCH v3 1/4] migration/qmp: Fix crash on setting tls-authz with null Peter Xu
2023-09-28 4:47 ` Michael Tokarev
2023-09-28 5:36 ` Markus Armbruster
2023-09-28 6:56 ` Michael Tokarev
2023-10-04 13:58 ` Juan Quintela
2023-10-16 6:05 ` Markus Armbruster
2023-09-05 16:23 ` [PATCH v3 2/4] tests/migration-test: Add a test for null parameter setups Peter Xu
2023-10-04 13:58 ` Juan Quintela
2023-09-05 16:23 ` [PATCH v3 3/4] migration/qapi: Replace @MigrateSetParameters with @MigrationParameters Peter Xu
2023-09-26 20:40 ` Markus Armbruster
2023-10-02 19:52 ` Peter Xu
2023-10-09 12:25 ` Markus Armbruster
2023-10-10 15:05 ` Peter Xu
2023-10-10 19:18 ` Markus Armbruster
2023-10-10 20:09 ` Peter Xu
2023-10-11 4:28 ` Markus Armbruster
2023-10-11 14:21 ` Markus Armbruster
2023-10-12 19:28 ` Peter Xu
2023-10-13 5:36 ` Markus Armbruster
2023-10-31 11:08 ` Juan Quintela
2023-11-02 14:25 ` Configuring migration (was: [PATCH v3 3/4] migration/qapi: Replace @MigrateSetParameters with @MigrationParameters) Markus Armbruster
2023-11-02 18:05 ` Peter Xu
2023-11-14 7:27 ` Configuring migration Markus Armbruster
2023-11-14 10:20 ` Juan Quintela
2023-11-14 9:13 ` Configuring migration (was: [PATCH v3 3/4] migration/qapi: Replace @MigrateSetParameters with @MigrationParameters) Daniel P. Berrangé
2023-11-14 9:53 ` Configuring migration Markus Armbruster
2023-11-14 9:55 ` Daniel P. Berrangé
2023-11-14 10:28 ` Juan Quintela
2023-11-14 10:34 ` Daniel P. Berrangé
2023-11-14 10:42 ` Juan Quintela
2023-11-14 10:45 ` Daniel P. Berrangé
2023-10-12 15:58 ` [PATCH v3 3/4] migration/qapi: Replace @MigrateSetParameters with @MigrationParameters Peter Xu
2023-10-13 5:41 ` Markus Armbruster
2023-09-05 16:23 ` [PATCH v3 4/4] migration/qapi: Drop @MigrationParameter enum Peter Xu
2023-09-06 4:42 ` Philippe Mathieu-Daudé
2023-09-06 9:00 ` Daniel P. Berrangé
2023-09-06 10:14 ` Philippe Mathieu-Daudé
2023-09-06 10:46 ` Daniel P. Berrangé
2023-09-26 19:05 ` Peter Xu
2023-09-26 20:43 ` Markus Armbruster
2023-10-02 20:42 ` Peter Xu
2023-10-16 6:29 ` Markus Armbruster
2023-10-16 16:16 ` Peter Xu
2023-10-16 17:36 ` Markus Armbruster
2023-09-25 12:59 ` [PATCH v3 0/4] qapi/migration: Dedup migration parameter objects and fix tls-authz crash Markus Armbruster
2023-09-26 17:06 ` Peter Xu
2023-09-26 20:03 ` Markus Armbruster
2023-10-16 7:08 ` Markus Armbruster
2023-10-16 16:29 ` Peter Xu
2023-10-17 6:32 ` Markus Armbruster [this message]
2023-10-17 15:28 ` Peter Xu
2023-10-18 5:38 ` Markus Armbruster
2023-10-25 13:17 ` QAPI doc generator improvements (was: [PATCH v3 0/4] qapi/migration: Dedup migration parameter objects and fix tls-authz crash) 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=87v8b5dajh.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=farosas@suse.de \
--cc=peterx@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=thuth@redhat.com \
/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).