On 10/03/2016 02:04 PM, Eduardo Habkost wrote:
Hi,
When adding new QMP commands that are implemented by
arch-specific code, we have been adding stubs that report
QERR_UNSUPPORTED (see stubs/arch-query-cpu-model-expansion.c for
an example).
3.1) Removing the command from query-commands and from the QAPI
schema on binaries that don't implement the command.
Needlessly complex?
Ideal goal, but we aren't there yet.
3.2) Removing the unimplemented command from query-commands only
(by calling qmp_disable_command()), but keeping it on the QAPI
schema. I am not sure it's OK to do that. If it is, this
sounds like the simplest solution.
We already have existing commands in this category, and it is
conceptually the easiest (if query-commands doesn't list the command,
then the command doesn't work even if the introspection still shows it).
In fact, that was part of the reason that Marc-Andre's work to remove
middle mode took so many revisions, because we were figuring out if it
was possible to get to the ideal option 3.1 (answer was not yet), then
deciding what the least disgusting hack was for sticking with option 3.2
after we dropped qemu-commands.hx (the hack currently in place, as of
qemu commit 5032a16d, is that all commands are now unconditionally
generated, but the tricky ones are now explicitly unregistered in C code
guarded by negative #ifdefs for the platforms where the command used to
be only conditionally generated from positive ifdefs in the .hx file, so
that the query-commands result is identical).
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org