Received: from eggs.gnu.org ([2001:4830:134:3::10]:51850) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsZh7-0007hi-17 for qemu-devel@nongnu.org; Fri, 07 Oct 2016 14:16:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bsZh5-0001BC-FK for qemu-devel@nongnu.org; Fri, 07 Oct 2016 14:16:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57932) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsZh5-0001AT-9Z for qemu-devel@nongnu.org; Fri, 07 Oct 2016 14:16:27 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D5D03C9423 for ; Fri, 7 Oct 2016 18:16:26 +0000 (UTC) From: Markus Armbruster Date: Fri, 7 Oct 2016 20:16:20 +0200 Message-Id: <1475864182-16550-10-git-send-email-armbru@redhat.com> In-Reply-To: <1475864182-16550-1-git-send-email-armbru@redhat.com> References: <1475864182-16550-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PULL v2 09/11] qmp: Disable query-cpu-* commands when they're unavailable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Eduardo Habkost From: Eduardo Habkost 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 Message-Id: <1475696941-8056-1-git-send-email-ehabkost@redhat.com> Reviewed-by: Eric Blake Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- monitor.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/monitor.c b/monitor.c index 83c4edf..4ff74b7 100644 --- a/monitor.c +++ b/monitor.c @@ -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) -- 2.5.5