From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SunFs-0001xS-8H for qemu-devel@nongnu.org; Fri, 27 Jul 2012 12:19:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SunFq-0001ui-Sa for qemu-devel@nongnu.org; Fri, 27 Jul 2012 12:19:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52064) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SunFq-0001uS-JS for qemu-devel@nongnu.org; Fri, 27 Jul 2012 12:19:06 -0400 Date: Fri, 27 Jul 2012 13:19:37 -0300 From: Luiz Capitulino Message-ID: <20120727131937.272651ef@doriath.home> In-Reply-To: <1343396239-19272-6-git-send-email-aliguori@us.ibm.com> References: <1343396239-19272-1-git-send-email-aliguori@us.ibm.com> <1343396239-19272-6-git-send-email-aliguori@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 5/7] qapi: add query-cpudefs command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Peter Maydell , libvir-list@redhat.com, qemu-devel@nongnu.org, Markus Armbruster , Alexander Graf , Eric Blake On Fri, 27 Jul 2012 08:37:17 -0500 Anthony Liguori wrote: > This command attempts to map to the behavior of -cpu ?. Unfortunately, the > output of this command differs wildly across targets. > > To accomodate this, we use a weak symbol to implement a default version of the > command that fails with a QERR_NOT_SUPPORTED error code. Targets can then > override and implement this command if it makes sense for them. > > Signed-off-by: Anthony Liguori > --- > qapi-schema.json | 23 +++++++++++++++++++++++ > qmp-commands.hx | 6 ++++++ > qmp.c | 6 ++++++ > 3 files changed, 35 insertions(+), 0 deletions(-) > > diff --git a/qapi-schema.json b/qapi-schema.json > index 5b47026..768fb44 100644 > --- a/qapi-schema.json > +++ b/qapi-schema.json > @@ -2228,3 +2228,26 @@ > # Since: 1.2.0 > ## > { 'command': 'query-machines', 'returns': ['MachineInfo'] } > + > +## > +# @CpuDefInfo: > +# > +# Virtual CPU definition. > +# > +# @name: the name of the CPU definition > +# > +# Since: 1.2.0 > +## > +{ 'type': 'CpuDefInfo', > + 'data': { 'name': 'str' } } > + > +## > +# @query-cpudefs: I'd call this query-cpu-defs or even query-cpu-difinitions. The latter makes it self-documenting. > +# > +# Return a list of supported virtual CPU definitions > +# > +# Returns: a list of CpuDefInfo > +# > +# Since: 1.2.0 > +## > +{ 'command': 'query-cpudefs', 'returns': ['CpuDefInfo'] } > diff --git a/qmp-commands.hx b/qmp-commands.hx > index a6f82fc..73dfeab 100644 > --- a/qmp-commands.hx > +++ b/qmp-commands.hx > @@ -2228,3 +2228,9 @@ EQMP > .mhandler.cmd_new = qmp_marshal_input_query_machines, > }, > > + { > + .name = "query-cpudefs", > + .args_type = "", > + .mhandler.cmd_new = qmp_marshal_input_query_cpudefs, > + }, > + > diff --git a/qmp.c b/qmp.c > index 254a32f..51b4f75 100644 > --- a/qmp.c > +++ b/qmp.c > @@ -467,3 +467,9 @@ DevicePropertyInfoList *qmp_device_list_properties(const char *typename, > > return prop_list; > } > + > +CpuDefInfoList GCC_WEAK *qmp_query_cpudefs(Error **errp) > +{ > + error_set(errp, QERR_NOT_SUPPORTED); > + return NULL; > +}