qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	libvir-list@redhat.com, qemu-devel@nongnu.org,
	Markus Armbruster <armbru@redhat.com>,
	Alexander Graf <agraf@suse.de>, Eric Blake <eblake@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 5/7] qapi: add query-cpudefs command
Date: Fri, 27 Jul 2012 13:19:37 -0300	[thread overview]
Message-ID: <20120727131937.272651ef@doriath.home> (raw)
In-Reply-To: <1343396239-19272-6-git-send-email-aliguori@us.ibm.com>

On Fri, 27 Jul 2012 08:37:17 -0500
Anthony Liguori <aliguori@us.ibm.com> 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 <aliguori@us.ibm.com>
> ---
>  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;
> +}

  parent reply	other threads:[~2012-07-27 16:19 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-27 13:37 [Qemu-devel] [PATCH 0/7] qapi: add commands to remove the need to parse -help output Anthony Liguori
2012-07-27 13:37 ` [Qemu-devel] [PATCH 1/7] qmp: introduce device-list-properties command Anthony Liguori
2012-07-27 16:05   ` Luiz Capitulino
2012-08-10 14:40     ` Anthony Liguori
2012-07-27 13:37 ` [Qemu-devel] [PATCH 2/7] qapi: mark QOM commands stable Anthony Liguori
2012-07-27 16:06   ` Luiz Capitulino
2012-08-10 14:40     ` Anthony Liguori
2012-07-27 13:37 ` [Qemu-devel] [PATCH 3/7] qapi: add query-machines command Anthony Liguori
2012-07-27 16:12   ` Luiz Capitulino
2012-08-10 14:41     ` Anthony Liguori
2012-08-10 14:50       ` Luiz Capitulino
2012-08-10 16:06         ` Anthony Liguori
2012-08-10 16:15           ` Luiz Capitulino
2012-07-27 17:25   ` Eric Blake
2012-07-27 18:12     ` Anthony Liguori
2012-07-27 18:28       ` Eric Blake
2012-07-27 13:37 ` [Qemu-devel] [PATCH 4/7] compiler: add macro for GCC weak symbols Anthony Liguori
2012-07-27 13:50   ` Peter Maydell
2012-07-27 14:27     ` Anthony Liguori
2012-07-27 14:45       ` Peter Maydell
2012-07-27 15:31         ` Anthony Liguori
2012-07-27 19:34           ` Blue Swirl
2012-07-27 20:51             ` Anthony Liguori
2012-07-27 21:04               ` Blue Swirl
2012-07-27 22:40                 ` Anthony Liguori
2012-07-28  6:25                   ` Markus Armbruster
2012-07-28  8:52                     ` Blue Swirl
2012-07-28  8:45                   ` Blue Swirl
2012-07-28  6:50           ` Peter Maydell
2012-07-28  8:58             ` Blue Swirl
2012-07-27 15:32     ` Anthony Liguori
2012-07-27 13:37 ` [Qemu-devel] [PATCH 5/7] qapi: add query-cpudefs command Anthony Liguori
2012-07-27 14:00   ` Peter Maydell
2012-07-27 15:01     ` Anthony Liguori
2012-07-27 16:19   ` Luiz Capitulino [this message]
2012-07-27 18:37   ` Eric Blake
2012-07-27 13:37 ` [Qemu-devel] [PATCH 6/7] target-i386: add implementation of query-cpudefs Anthony Liguori
2012-07-31 15:57   ` Eduardo Habkost
2012-08-10 14:43     ` Anthony Liguori
2012-08-10 15:59       ` Eduardo Habkost
2012-08-10 16:37         ` Anthony Liguori
2012-08-10 16:51           ` Eduardo Habkost
2012-08-10 17:09             ` Anthony Liguori
2012-08-10 17:31               ` Eduardo Habkost
2012-07-27 13:37 ` [Qemu-devel] [PATCH 7/7] target-ppc: " Anthony Liguori
2012-07-27 16:21 ` [Qemu-devel] [PATCH 0/7] qapi: add commands to remove the need to parse -help output Luiz Capitulino
2012-07-27 16:37   ` Daniel P. Berrange

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120727131937.272651ef@doriath.home \
    --to=lcapitulino@redhat.com \
    --cc=agraf@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=libvir-list@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).