From: Markus Armbruster <armbru@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: mdroth@linux.vnet.ibm.com, marcandre.lureau@gmail.com,
Markus Armbruster <armbru@redhat.com>,
qemu-devel@nongnu.org
Subject: Re: [PATCH v5 5/8] qapi: Implement deprecated-output=hide for QMP introspection
Date: Mon, 21 Sep 2020 16:41:19 +0200 [thread overview]
Message-ID: <87h7rr19bk.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <8680f11b-e26d-0c64-57eb-0b0e5aae330e@redhat.com> (Eric Blake's message of "Mon, 14 Sep 2020 10:43:33 -0500")
Eric Blake <eblake@redhat.com> writes:
> On 9/14/20 3:47 AM, Markus Armbruster wrote:
>> This policy suppresses deprecated bits in output, and thus permits
>> "testing the future". Implement it for QMP command query-qmp-schema:
>> suppress information on deprecated commands, events and object type
>> members, i.e. anything that has the special feature flag "deprecated".
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>> qapi/introspect.json | 2 +-
>> monitor/monitor-internal.h | 3 -
>> monitor/misc.c | 2 -
>> monitor/qmp-cmds-control.c | 100 +++++++++++++++++++++++----
>> storage-daemon/qemu-storage-daemon.c | 2 -
>> 5 files changed, 89 insertions(+), 20 deletions(-)
>> diff --git a/qapi/introspect.json b/qapi/introspect.json
>> index 944bb87a20..39bd303778 100644
>> --- a/qapi/introspect.json
>> +++ b/qapi/introspect.json
>> @@ -49,7 +49,7 @@
>> ##
>> { 'command': 'query-qmp-schema',
>> 'returns': [ 'SchemaInfo' ],
>> - 'gen': false } # just to simplify qmp_query_json()
>> + 'allow-preconfig': true }
>
> Interesting change. Dropping 'gen':false is explained below...
>
>> @@ -153,17 +157,89 @@ EventInfoList *qmp_query_events(Error **errp)
>> return ev_list;
>> }
>> -/*
>> - * Minor hack: generated marshalling suppressed for this command
>> - * ('gen': false in the schema) so we can parse the JSON string
>> - * directly into QObject instead of first parsing it with
>> - * visit_type_SchemaInfoList() into a SchemaInfoList, then marshal it
>> - * to QObject with generated output marshallers, every time. Instead,
>> - * we do it in test-qobject-input-visitor.c, just to make sure
>> - * qapi-gen.py's output actually conforms to the schema.
>> - */
>> -void qmp_query_qmp_schema(QDict *qdict, QObject **ret_data,
>> - Error **errp)
>> +static void *split_off_generic_list(void *list,
>> + bool (*splitp)(void *elt),
>> + void **part)
>
> ...but adding 'allow-preconfig':true, while it makes sense, seems a
> bit unrelated.
It's not, actually: query-qmp-schema has always worked in preconfig
state. Current master:
$ upstream-qemu -nodefaults -S -display none -qmp stdio -preconfig
{"QMP": {"version": {"qemu": {"micro": 50, "minor": 1, "major": 5}, "package": ""}, "capabilities": ["oob"]}}
{"execute": "qmp_capabilities"}
{"return": {}}
{"execute": "query-qmp-schema"}
{"return": [{"name": "query-status", ...}}
{"execute": "query-block"}
{"error": {"class": "GenericError", "desc": "The command 'query-block' isn't permitted in 'preconfig' state"}}
We better keep it working there.
> Worth a better commit message?
Yes.
> Reviewed-by: Eric Blake <eblake@redhat.com>
Thanks!
next prev parent reply other threads:[~2020-09-21 14:43 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-14 8:47 [PATCH v5 0/8] Configurable policy for handling deprecated interfaces Markus Armbruster
2020-09-14 8:47 ` [PATCH v5 1/8] qemu-options: New -compat to set policy for " Markus Armbruster
2020-09-14 11:50 ` Peter Krempa
2020-09-21 14:35 ` Markus Armbruster
2020-09-14 15:08 ` Eric Blake
2020-09-21 12:01 ` Richard W.M. Jones
2020-09-14 8:47 ` [PATCH v5 2/8] qapi: Implement deprecated-output=hide for QMP command results Markus Armbruster
2020-09-14 8:47 ` [PATCH v5 3/8] qapi: Implement deprecated-output=hide for QMP events Markus Armbruster
2020-09-14 15:19 ` Eric Blake
2020-09-14 8:47 ` [PATCH v5 4/8] qapi: Implement deprecated-output=hide for QMP event data Markus Armbruster
2020-09-14 15:35 ` Eric Blake
2020-09-14 8:47 ` [PATCH v5 5/8] qapi: Implement deprecated-output=hide for QMP introspection Markus Armbruster
2020-09-14 15:43 ` Eric Blake
2020-09-21 14:41 ` Markus Armbruster [this message]
2020-09-14 8:48 ` [PATCH v5 6/8] qapi: Implement deprecated-input=reject for QMP commands Markus Armbruster
2020-09-14 15:45 ` Eric Blake
2020-09-14 8:48 ` [PATCH v5 7/8] qapi: Implement deprecated-input=reject for QMP command arguments Markus Armbruster
2020-09-14 15:57 ` Eric Blake
2020-09-14 8:48 ` [PATCH v5 8/8] qapi: New -compat deprecated-input=crash Markus Armbruster
2020-09-14 15:58 ` Eric Blake
2020-09-21 14:42 ` Markus Armbruster
2020-09-21 12:45 ` [PATCH v5 0/8] Configurable policy for handling deprecated interfaces Richard W.M. Jones
2020-09-21 12:54 ` Peter Krempa
2020-09-21 12:58 ` Richard W.M. Jones
2020-09-21 12:56 ` Peter Maydell
2020-09-21 14:58 ` Markus Armbruster
2020-09-21 16:28 ` Peter Maydell
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=87h7rr19bk.fsf@dusky.pond.sub.org \
--to=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=marcandre.lureau@gmail.com \
--cc=mdroth@linux.vnet.ibm.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.