提交 728b1429 编写于 作者: E Eduardo Habkost 提交者: Markus Armbruster

qmp: Disable query-cpu-* commands when they're unavailable

Instead of requiring clients to actually call the query-cpu-*
commands to find out if they are implemented, remove them from
the output of "query-commands", so clients know they are not
available.

This is implemented by extending the existing hack at
qmp_unregister_commands_hack(). I wish I could avoid adding even
more #ifdefs to that code, but that's the solution we have today.
Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
Message-Id: <1475696941-8056-1-git-send-email-ehabkost@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
上级 daf5dc78
...@@ -992,6 +992,15 @@ static void qmp_unregister_commands_hack(void) ...@@ -992,6 +992,15 @@ static void qmp_unregister_commands_hack(void)
#ifndef TARGET_ARM #ifndef TARGET_ARM
qmp_unregister_command("query-gic-capabilities"); qmp_unregister_command("query-gic-capabilities");
#endif #endif
#if !defined(TARGET_S390X)
qmp_unregister_command("query-cpu-model-expansion");
qmp_unregister_command("query-cpu-model-baseline");
qmp_unregister_command("query-cpu-model-comparison");
#endif
#if !defined(TARGET_PPC) && !defined(TARGET_ARM) && !defined(TARGET_I386) \
&& !defined(TARGET_S390X)
qmp_unregister_command("query-cpu-definitions");
#endif
} }
static void qmp_init_marshal(void) static void qmp_init_marshal(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册