]> git.proxmox.com Git - mirror_qemu.git/commit - monitor.c
qmp: Hack to keep commands configuration-specific
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Mon, 12 Sep 2016 09:19:02 +0000 (13:19 +0400)
committerMarkus Armbruster <armbru@redhat.com>
Mon, 19 Sep 2016 15:32:21 +0000 (17:32 +0200)
commit5032a16d1d44cc805ea0240903dc8dc98294da1f
tree5d53012db4b163bc3a22be08afb4609b8fe8a32a
parent60b03e4e6ac6eee3acac3c3173180f43adc6ddd5
qmp: Hack to keep commands configuration-specific

We currently define QMP commands in two places: the QAPI schema and
qmp-commands.hx.  The latter is preprocessed, the former is not.  We
use the preprocessor to suppress configuration-specific commands.  For
instance, query-spice is only available #ifdef CONFIG_SPICE.

QMP command dispatch and query-commands use the qmp-commands.hx
definition, and thus obey the #ifdeffery there.  Good, because it lets
QMP clients probe for available features more easily.

query-qmp-schema uses the QAPI schema, and thus lists the
configuration-specific commands even when they're unavailable.  Not so
good.

We're about to flip command dispatch and query-commands to the
non-middle-mode command registry, which uses the QAPI schema, so we
can ditch qmp-commands.hx.  To avoid regressing query-commands,
arrange for commands that are suppressed with the preprocessor now to
be unregistered with that registry.  This will keep them unavailable
and out of query-commands when we flip command dispatch and
query-commands to that registry, exactly as before.

This is a hack.  The proper solution is to support
configuration-specific commands in the QAPI schema.  Mark it FIXME.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20160912091913.15831-8-marcandre.lureau@redhat.com>
monitor.c