From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57480) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOtYP-0000r8-Qq for qemu-devel@nongnu.org; Thu, 28 Jan 2016 15:52:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aOtYM-0000Q8-9M for qemu-devel@nongnu.org; Thu, 28 Jan 2016 15:52:33 -0500 References: <1453960195-15181-1-git-send-email-bharata@linux.vnet.ibm.com> <1453960195-15181-13-git-send-email-bharata@linux.vnet.ibm.com> From: Eric Blake Message-ID: <56AA7F8A.2080903@redhat.com> Date: Thu, 28 Jan 2016 13:52:26 -0700 MIME-Version: 1.0 In-Reply-To: <1453960195-15181-13-git-send-email-bharata@linux.vnet.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="1X34QK0d5urL1P5GQD6GK54p0bpCiie0L" Subject: Re: [Qemu-devel] [PATCH v7 12/13] qmp: Add query-ppc-cpu-cores command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bharata B Rao , qemu-devel@nongnu.org Cc: mjrosato@linux.vnet.ibm.com, ehabkost@redhat.com, imammedo@redhat.com, aik@ozlabs.ru, Markus Armbruster , agraf@suse.de, mdroth@linux.vnet.ibm.com, =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , qemu-ppc@nongnu.org, tyreld@linux.vnet.ibm.com, nfont@linux.vnet.ibm.com, pbonzini@redhat.com, afaerber@suse.de, david@gibson.dropbear.id.au This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --1X34QK0d5urL1P5GQD6GK54p0bpCiie0L Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/27/2016 10:49 PM, Bharata B Rao wrote: > Show the details of PPC CPU cores via a new QMP command. >=20 > TODO: update qmp-commands.hx with example Is this a stale comment? [1] >=20 > Signed-off-by: Bharata B Rao > --- > #include > +#include > #include "qemu/error-report.h" > +#include "qmp-commands.h" > + > +/* > + * QMP: info ppc-cpu-cores > + */ > +static int qmp_ppc_cpu_list(Object *obj, void *opaque) Comment is a bit off - 'info ...' is an HMP command; this callback is helping implement the QMP function query-ppc-cpu-cores. > +++ b/qapi-schema.json > @@ -4083,3 +4083,34 @@ > ## > { 'enum': 'ReplayMode', > 'data': [ 'none', 'record', 'play' ] } > + > +## > +# @PPCCPUCore: > +# > +# Information about PPC CPU core devices > +# > +# @hotplugged: true if device was hotplugged > +# > +# @hotpluggable: true if device if could be added/removed while machin= e is running > +# > +# Since: 2.6 Missing docs on 'id' and 'threads'. > +## > + > +{ 'struct': 'PPCCPUCore', > + 'data': { '*id': 'str', > + 'hotplugged': 'bool', > + 'hotpluggable': 'bool', > + 'threads' : ['CpuInfo'] > + } > +} > + > +## > +# @query-ppc-cpu-core: > +# > +# Returns information for all PPC CPU core devices > +# > +# Returns: a list of @PPCCPUCore. > +# > +# Since: 2.6 > +## > +{ 'command': 'query-ppc-cpu-cores', 'returns': ['PPCCPUCore'] } Interface seems okay. > +++ b/qmp-commands.hx > @@ -4795,3 +4795,54 @@ Example: > {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 38= 40, > "pop-vlan": 1, "id": 251658240} > ]} > + > +EQMP > + > +#if defined TARGET_PPC64 > + { > + .name =3D "query-ppc-cpu-cores", > + .args_type =3D "", > + .mhandler.cmd_new =3D qmp_marshal_query_ppc_cpu_cores, > + }, > +#endif Hmm. Conditional compilation. Does the command show up in 'query-commands' and introspection output, even when the target is not ppc64? We may need to fix qapi introspection to support conditionals better; maybe some of Marc-Andre's patches towards eliminating qmp-commands.hx will come into play here. > + > +SQMP > +@query-ppc-cpu-cores > +-------------------- > + > +Show PowerPC CPU core devices information. > + > +Example: > +-> { "execute": "query-ppc-cpu-cores" } > +<- {"return": [{"threads": [ > + {"arch": "ppc", [1] looks like you provided an example after all. Is it worth documenting that this command is only conditionally available? > +++ b/stubs/qmp_query_ppc_cpu_cores.c > @@ -0,0 +1,10 @@ > +#include "qom/object.h" > +#include "qapi/qmp/qerror.h" > +#include "qemu/typedefs.h" > +#include "qmp-commands.h" > + > +PPCCPUCoreList *qmp_query_ppc_cpu_cores(Error **errp) > +{ > + error_setg(errp, QERR_UNSUPPORTED); > + return 0; > +} Hmm - will the stub even be used, since you used an #ifdef in the .hx fil= e? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --1X34QK0d5urL1P5GQD6GK54p0bpCiie0L 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/ iQEcBAEBCAAGBQJWqn+KAAoJEKeha0olJ0NqiTkH/j4X2z1wkGiKGYsT7xoyH9EY 41ZGgbJlCcpa7CzHMgbGxSWRYjBIhXhCayaQwkdfxuSkrFkvsa9lxr3Y59/h6a8p FwI61RpM8P+TtPFaTqvMHlwvTc24jMbZaZ//6jmkDgW7Z9nhx6SR/q7otBOyYl34 OrPUuE/6hlE37tKf0D3uCmZwr62spscg7sYpMez9Jc2x/YCK+VF6CzZzQH1/8NWW /KMKMo/e+jkyCRL4oiVQPlJLI13ZNRxqZjCystGsKwEBl6OsCR4rXeTq78QbLbJb fG86w5S62ni8djTCMXO5ig6qeZxVWBmfNvA3LZtw5KOLRiv+4DYiir+FFqRg2a4= =ETAV -----END PGP SIGNATURE----- --1X34QK0d5urL1P5GQD6GK54p0bpCiie0L--