diff options
author | Markus Armbruster <armbru@redhat.com> | 2021-03-18 16:55:14 +0100 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2021-03-19 16:05:09 +0100 |
commit | 624fa80c8c199229af7ff42eb20b5b2ab851e4ee (patch) | |
tree | 77b132f8d37ed948dd864fd6bb5f698f5163628a /qapi | |
parent | a291a38fa1db6a67bd9046da26a48e82c591ca49 (diff) | |
download | qemu-624fa80c8c199229af7ff42eb20b5b2ab851e4ee.zip |
monitor: Drop query-qmp-schema 'gen': false hack
QMP commands return their response as a generated QAPI type, which the
monitor core converts to JSON via QObject.
query-qmp-schema's response is the generated introspection data. This
is a QLitObject since commit 7d0f982bfb "qapi: generate a literal
qobject for introspection", v2.12). Before, it was a string. Instead
of converting QLitObject / string -> QObject -> QAPI type
SchemaInfoList -> QObject -> JSON, we take a shortcut: the command is
'gen': false, so it can return the QObject instead of the QAPI type.
Slightly simpler and more efficient.
The next commit will filter the response for output policy, and this
is easier in the SchemaInfoList representation. Drop the shortcut.
This replaces the manual command registration by a generated one. The
manual registration makes the command available before the machine is
built by passing flag QCO_ALLOW_PRECONFIG. To keep it available
there, we need need to add 'allow-preconfig': true to its definition
in the schema.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20210318155519.1224118-7-armbru@redhat.com>
Diffstat (limited to 'qapi')
-rw-r--r-- | qapi/introspect.json | 2 |
1 files changed, 1 insertions, 1 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 } ## # @SchemaMetaType: |