qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5 5/8] qapi: Implement deprecated-output=hide for QMP intros


From: Eric Blake
Subject: Re: [PATCH v5 5/8] qapi: Implement deprecated-output=hide for QMP introspection
Date: Mon, 14 Sep 2020 10:43:33 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0

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. Worth a better commit message?

Reviewed-by: Eric Blake <eblake@redhat.com>

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]