Received: from eggs.gnu.org ([2001:4830:134:3::10]:39988) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsTuG-0006a0-N2 for qemu-devel@nongnu.org; Fri, 07 Oct 2016 08:05:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bsTuA-0003FU-Hp for qemu-devel@nongnu.org; Fri, 07 Oct 2016 08:05:39 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:49953) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsTuA-0003Ep-7u for qemu-devel@nongnu.org; Fri, 07 Oct 2016 08:05:34 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u97BwxnG075280 for ; Fri, 7 Oct 2016 08:05:33 -0400 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 25x6mkbya0-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 07 Oct 2016 08:05:32 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 7 Oct 2016 13:05:30 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 4BC1B219004D for ; Fri, 7 Oct 2016 13:04:47 +0100 (BST) Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u97C5Tj214549374 for ; Fri, 7 Oct 2016 12:05:29 GMT Received: from d06av10.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u97B5UF7017068 for ; Fri, 7 Oct 2016 05:05:30 -0600 References: <1475696941-8056-1-git-send-email-ehabkost@redhat.com> From: Christian Borntraeger Date: Fri, 7 Oct 2016 14:05:27 +0200 MIME-Version: 1.0 In-Reply-To: <1475696941-8056-1-git-send-email-ehabkost@redhat.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Message-Id: <338be575-0ae8-196c-e090-9cf2ba09161c@de.ibm.com> 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 , qemu-devel@nongnu.org, armbru@redhat.com Cc: peter.maydell@linaro.org, dahi@linux.vnet.ibm.com, agraf@suse.de, jjherne@linux.vnet.ibm.com, cornelia.huck@de.ibm.com, pbonzini@redhat.com, jdenemar@redhat.com, david@gibson.dropbear.id.au, eblake@redhat.com, rth@twiddle.net On 10/05/2016 09:49 PM, Eduardo Habkost wrote: > 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 Had no chance to test that, but the patch looks sane. > } > > static void qmp_init_marshal(void) >