Skip to content

Commit

Permalink
qmp: Disable query-cpu-* commands when they're unavailable
Browse files Browse the repository at this point in the history
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: Eduardo Habkost <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
  • Loading branch information
ehabkost authored and Markus Armbruster committed Oct 7, 2016
1 parent daf5dc7 commit 728b142
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,15 @@ static void qmp_unregister_commands_hack(void)
#ifndef TARGET_ARM
qmp_unregister_command("query-gic-capabilities");
#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)
Expand Down

0 comments on commit 728b142

Please sign in to comment.