From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59087) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFTXc-0001Np-Be for qemu-devel@nongnu.org; Tue, 21 Jun 2016 17:49:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFTXZ-0000xJ-8F for qemu-devel@nongnu.org; Tue, 21 Jun 2016 17:49:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44107) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFTXZ-0000xF-0C for qemu-devel@nongnu.org; Tue, 21 Jun 2016 17:49:01 -0400 References: <1466453564-7572-1-git-send-email-ehabkost@redhat.com> <1466453564-7572-2-git-send-email-ehabkost@redhat.com> From: Eric Blake Message-ID: <5769B64A.9000508@redhat.com> Date: Tue, 21 Jun 2016 15:48:58 -0600 MIME-Version: 1.0 In-Reply-To: <1466453564-7572-2-git-send-email-ehabkost@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="B4PgtLindLEoRtcKw1uOHOhG6ia3kSMuo" Subject: Re: [Qemu-devel] [PATCH 1/3] qmp: Add query-host-cpu command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost , qemu-devel@nongnu.org Cc: libvir-list@redhat.com, dahi@linux.vnet.ibm.com, Jiri Denemark , Igor Mammedov This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --B4PgtLindLEoRtcKw1uOHOhG6ia3kSMuo From: Eric Blake To: Eduardo Habkost , qemu-devel@nongnu.org Cc: libvir-list@redhat.com, dahi@linux.vnet.ibm.com, Jiri Denemark , Igor Mammedov Message-ID: <5769B64A.9000508@redhat.com> Subject: Re: [Qemu-devel] [PATCH 1/3] qmp: Add query-host-cpu command References: <1466453564-7572-1-git-send-email-ehabkost@redhat.com> <1466453564-7572-2-git-send-email-ehabkost@redhat.com> In-Reply-To: <1466453564-7572-2-git-send-email-ehabkost@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06/20/2016 02:12 PM, Eduardo Habkost wrote: > The command can be used to return host-specific CPU capabilities > information. >=20 > Signed-off-by: Eduardo Habkost > --- > 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 >=20 > 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); > =20 > CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp); > +void arch_query_host_cpu_info(HostCPUInfo *r, bool migratable, Error *= *errp); > =20 > #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']= } > =20 > + > +## > +# @HostCPUInfo: > +# > +# Information on CPU capabilities supported by the current host. > +# > +# @qom-properties: #optional Values of CPU QOM properties correspondin= g > +# 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 proper= ty > +# 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 configuratio= n. > +# > +# Returns: A HostCPUInfo object. > +# > +# Since: 2.7.0 > +## > +{ 'command': 'query-host-cpu', 'data': { '*migratable': 'bool' }, > + 'returns': 'HostCPUInfo' } > + > # @AddfdInfo: --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --B4PgtLindLEoRtcKw1uOHOhG6ia3kSMuo Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXabZLAAoJEKeha0olJ0Nqba4H/it2Sg90hug/DBawD0+czUeN rbptzv9MxfYZpOSzQpvpB6mJcqCGWfVT6qN1guyDBJwb8bRI8NCq6JPkGNxdxvKz Lios0GqM3bfOezM8ljIpAWDEqrNXJ0/m2eVAqLP6vURbcd65lCit5GW5oQ3WX1dc qihS7o45+P5ME0YHvyhF5axaMijkOmNidrJAIrCt5HVq45UKyZG68iYen9huNANf RmD9ACt9tTsUzp0HzpFsexV/gzxGdVUNZI8od7EEmPVoGKUiTO2NPbkodm7d9rMz VSPIlaU7jV65HolEPkfzZm7OZx7nUyPLtIl53yWyV/coblK6aLi/6/QcIGA+RAQ= =q73A -----END PGP SIGNATURE----- --B4PgtLindLEoRtcKw1uOHOhG6ia3kSMuo--