From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bs9UU-00020C-ML for qemu-devel@nongnu.org; Thu, 06 Oct 2016 10:17:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bs9UO-00045R-L1 for qemu-devel@nongnu.org; Thu, 06 Oct 2016 10:17:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35624) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bs9UO-00045J-ET for qemu-devel@nongnu.org; Thu, 06 Oct 2016 10:17:36 -0400 From: Markus Armbruster References: <1475696941-8056-1-git-send-email-ehabkost@redhat.com> Date: Thu, 06 Oct 2016 16:17:32 +0200 In-Reply-To: <1475696941-8056-1-git-send-email-ehabkost@redhat.com> (Eduardo Habkost's message of "Wed, 5 Oct 2016 16:49:01 -0300") Message-ID: <87vax5ef43.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v2] qmp: Disable query-cpu-* commands when they're unavailable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: qemu-devel@nongnu.org, peter.maydell@linaro.org, dahi@linux.vnet.ibm.com, agraf@suse.de, borntraeger@de.ibm.com, jjherne@linux.vnet.ibm.com, cornelia.huck@de.ibm.com, pbonzini@redhat.com, jdenemar@redhat.com, rth@twiddle.net, david@gibson.dropbear.id.au Eduardo Habkost writes: > 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 > --- > Changes v1 -> v2: > * Instead of adding new qmp_commands_init() and > arch_qmp_commands_init() functions, simply extend the hack at > qmp_unregister_commands_hack() > --- > 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) Reviewed-by: Markus Armbruster