From: Eric Blake <eblake@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>, qemu-devel@nongnu.org
Cc: libvir-list@redhat.com, dahi@linux.vnet.ibm.com,
Jiri Denemark <jdenemar@redhat.com>,
Igor Mammedov <imammedo@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1/3] qmp: Add query-host-cpu command
Date: Tue, 21 Jun 2016 15:48:58 -0600 [thread overview]
Message-ID: <5769B64A.9000508@redhat.com> (raw)
In-Reply-To: <1466453564-7572-2-git-send-email-ehabkost@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 3550 bytes --]
On 06/20/2016 02:12 PM, Eduardo Habkost wrote:
> The command can be used to return host-specific CPU capabilities
> information.
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> include/sysemu/arch_init.h | 1 +
> qapi-schema.json | 36 ++++++++++++++++++++++++++++++++++++
> qmp-commands.hx | 6 ++++++
> qmp.c | 13 +++++++++++++
> stubs/Makefile.objs | 1 +
> stubs/arch-query-host-cpu-info.c | 8 ++++++++
> 6 files changed, 65 insertions(+)
> create mode 100644 stubs/arch-query-host-cpu-info.c
>
> diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h
> index d690dfa..54215ab 100644
> --- a/include/sysemu/arch_init.h
> +++ b/include/sysemu/arch_init.h
> @@ -35,5 +35,6 @@ int kvm_available(void);
> int xen_available(void);
>
> CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp);
> +void arch_query_host_cpu_info(HostCPUInfo *r, bool migratable, Error **errp);
>
> #endif
> diff --git a/qapi-schema.json b/qapi-schema.json
> index 19e3ef2..d2f4879 100644
> --- a/qapi-schema.json
> +++ b/qapi-schema.json
> @@ -3047,6 +3047,42 @@
> ##
> { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
>
> +
> +##
> +# @HostCPUInfo:
> +#
> +# Information on CPU capabilities supported by the current host.
> +#
> +# @qom-properties: #optional Values of CPU QOM properties corresponding
> +# to CPU capabilities supported by the host.
> +#
> +# Most properties returned in qom-properties are boolean properties
> +# indicating if a feature can be enabled in the current host. Other
> +# non-boolean properties may be returned, the semantics of each property
> +# depend on the architecture-specific code that handle them.
> +#
> +# Since: 2.7.0
Most places in .json files list just 'Since: x.y' rather than 'x.y.z',
but we aren't consistent enough to insist either way on including or
excluding a micro release number.
> +##
> +{ 'struct': 'HostCPUInfo',
> + 'data': { '*qom-properties': 'any' } }
This is a big hammer that makes the properties non-introspectible - a
client can tell that properties will be returned, but cannot tell which
properties to expect nor what format to expect for a given property
name. I don't know that the interface could be made easily
introspectible or not (it would probably require some QAPI unions, and a
LOT more generated code). So it would be nice if we could explore how
hard it would be to use a type-safe representation instead of 'any',
before declaring that this is the best we can do. Or, it may be the
sign of a bigger issue that we have no good way to introspect what qom
properties to expect, in general (and that solving that would also solve
this).
> +
> +##
> +# @query-host-cpu:
> +#
> +# @migratable: #optional If false, unmigratable features will be
> +# returned as well. If true, only migratable features
> +# will be returned. Defaults to true.
> +#
> +# Return information about CPU capabilities in the current host.
> +# The returned data may depend on machine and accelerator configuration.
> +#
> +# Returns: A HostCPUInfo object.
> +#
> +# Since: 2.7.0
> +##
> +{ 'command': 'query-host-cpu', 'data': { '*migratable': 'bool' },
> + 'returns': 'HostCPUInfo' }
> +
> # @AddfdInfo:
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2016-06-21 21:49 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-20 20:12 [Qemu-devel] [PATCH 0/3] qmp: query-host-cpu command Eduardo Habkost
2016-06-20 20:12 ` [Qemu-devel] [PATCH 1/3] qmp: Add " Eduardo Habkost
2016-06-21 21:48 ` Eric Blake [this message]
2016-06-23 16:37 ` Eduardo Habkost
2016-06-20 20:12 ` [Qemu-devel] [PATCH 2/3] target-i386: Introduce x86_cpu_load_host_data() function Eduardo Habkost
2016-06-23 14:59 ` Igor Mammedov
2016-06-23 16:04 ` Eduardo Habkost
2016-06-23 16:56 ` Igor Mammedov
2016-06-23 19:16 ` Eduardo Habkost
2016-06-20 20:12 ` [Qemu-devel] [PATCH 3/3] target-i386: Implement arch_query_host_cpu_info() Eduardo Habkost
2016-06-21 6:20 ` [Qemu-devel] [PATCH 0/3] qmp: query-host-cpu command David Hildenbrand
2016-06-21 12:45 ` Eduardo Habkost
2016-06-21 12:52 ` David Hildenbrand
2016-06-21 16:15 ` Eduardo Habkost
2016-06-21 17:04 ` David Hildenbrand
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=5769B64A.9000508@redhat.com \
--to=eblake@redhat.com \
--cc=dahi@linux.vnet.ibm.com \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=jdenemar@redhat.com \
--cc=libvir-list@redhat.com \
--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).