Re: [Qemu-devel] [RFC PATCH v2 11/15] cpu-model/s390: Add QMP command query-cpu-model

From: Eric Blake
Date: Tue Feb 17 2015 - 13:03:30 EST


On 02/17/2015 07:24 AM, Michael Mueller wrote:
> This patch implements a new QMP request named 'query-cpu-model'.
> It returns the cpu model of cpu 0 and its backing accelerator.
>
> request:
> {"execute" : "query-cpu-model" }
>
> answer:
> {"return" : {"name": "2827-ga2", "accelerator": "kvm" }}
>
> Alias names are resolved to their respective machine type and GA names
> already during cpu instantiation. Thus, also a cpu model like 'host'
> which is implemented as alias will return its normalized cpu model name.
>
> Furthermore the patch implements the following functions:
>
> - s390_cpu_typename(), returns the currently selected cpu type name or NULL
> - s390_cpu_models_used(), returns true if S390 cpu models are in use
>
> Signed-off-by: Michael Mueller <mimu@xxxxxxxxxxxxxxxxxx>
> ---
>
> +##
> +# @CpuModelInfo:
> +#
> +# Virtual CPU model definition.
> +#
> +# @name: the name of the CPU model definition
> +#
> +# Since: 2.3.0
> +##
> +{ 'type': 'CpuModelInfo',
> + 'data': { 'name': 'str', '*accelerator': 'AccelId' } }

You didn't document '*accelerator', including mention that it is
optional (why would it not be output always?).

> +
> +##
> +# @query-cpu-model:
> +#
> +# Return to current virtual CPU model

s/to/the/

> +#
> +# Returns: CpuModelInfo
> +#
> +# Since: 2.3.0

We aren't very consistent on '2.3' vs. '2.3.0', so I won't complain
about that.

> +##
> +{ 'command': 'query-cpu-model', 'returns': 'CpuModelInfo' }

Seems reasonable from the interface point of view; I have not closely
reviewed the implementation.

--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature