From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51754) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpLrn-0008Fx-WA for qemu-devel@nongnu.org; Mon, 04 May 2015 15:17:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YpLrk-0002C0-GM for qemu-devel@nongnu.org; Mon, 04 May 2015 15:17:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47819) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpLrk-0002Bt-9h for qemu-devel@nongnu.org; Mon, 04 May 2015 15:17:20 -0400 Message-ID: <5547C5B2.7050600@redhat.com> Date: Mon, 04 May 2015 13:17:06 -0600 From: Eric Blake MIME-Version: 1.0 References: <1430766598-8512-1-git-send-email-ehabkost@redhat.com> In-Reply-To: <1430766598-8512-1-git-send-email-ehabkost@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ruWmPaLpkm8MgdBvWKurCpDSSohUh3KgW" Subject: Re: [Qemu-devel] [PATCH] qmp: Add qom-path field to query-cpus command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, peter.crosthwaite@xilinx.com, mimu@linux.vnet.ibm.com, Igor Mammedov , agraf@suse.de, mdroth@linux.vnet.ibm.com, borntraeger@de.ibm.com, bharata@linux.vnet.ibm.com, cornelia.huck@de.ibm.com, Paolo Bonzini , Jiri Denemark , lcapitulino@redhat.com, =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= , david@gibson.dropbear.id.au This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ruWmPaLpkm8MgdBvWKurCpDSSohUh3KgW Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/04/2015 01:09 PM, Eduardo Habkost wrote: > This will allow clients to query additional information directly using > qom-get on the CPU objects. >=20 > Signed-off-by: Eduardo Habkost > --- > Reference to previous discussion: >=20 > Date: Mon, 4 May 2015 15:37:40 -0300 > From: Eduardo Habkost > Message-ID: <20150504183740.GM17796@thinpad.lan.raisama.net> > Subject: Re: [Qemu-devel] [PATCH] cpu: Register QOM links at /machine= /cpus/ >=20 > The summary is: even if we provide predictable QOM paths for the CPU > objects, the qom-path field will be useful to allow the QOM objects and= > query-cpu data to be matched correctly. > --- > +++ b/qapi-schema.json > @@ -602,6 +602,8 @@ > # @halted: true if the virtual CPU is in the halt state. Halt usually= refers > # to a processor specific low power mode. > # > +# @qom-path: path to the CPU object in the QOM tree. > +# Needs a '(since 2.4)' designation. But definitely looks useful. > # @pc: #optional If the target is i386 or x86_64, this is the 64-bit i= nstruction > # pointer. > # If the target is Sparc, this is the PC component of t= he > @@ -622,8 +624,9 @@ > # data is sent to the client, the guest may no longer be halted= =2E > ## > { 'type': 'CpuInfo', Rebase context fun once my series goes in that does s/type/struct/ > - 'data': {'CPU': 'int', 'current': 'bool', 'halted': 'bool', '*pc': '= int', > - '*nip': 'int', '*npc': 'int', '*PC': 'int', 'thread_id': 'i= nt'} } > + 'data': {'CPU': 'int', 'current': 'bool', 'halted': 'bool', 'qom-pat= h': 'str', > + '*pc': 'int', '*nip': 'int', '*npc': 'int', '*PC': 'int', > + 'thread_id': 'int'} } We now have a mix of _ (thread_id) and - (qom-path). It might be nice to someday teach QMP to interchange either spelling. I'm on the fence as to whether this should use qom_path in order to be consistent within the struct itself. > +++ b/qmp-commands.hx > @@ -2569,6 +2569,7 @@ Return a json-array. Each CPU is represented by a= json-object, which contains: > - "CPU": CPU index (json-int) > - "current": true if this is the current CPU, false otherwise (json-bo= ol) > - "halted": true if the cpu is halted, false otherwise (json-bool) > +- "qom-path": path to the CPU object in the QOM tree (json-str) > - Current program counter. The key's name depends on the architecture:= > "pc": i386/x86_64 (json-int) > "nip": PPC (json-int) The new output is not optional, so the example needs to be updated to show it. For that matter, the example is broken, so you could fix it while touching it: "return":[ { "CPU":0, "current":true, "halted":false, "pc":3227107138 "thread_id":3134 is not valid JSON, since there is a missing comma for "pc". --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --ruWmPaLpkm8MgdBvWKurCpDSSohUh3KgW 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/ iQEcBAEBCAAGBQJVR8WyAAoJEKeha0olJ0Nq3yUH/Ri5IpuzKFEeU37FiAXbmWla EouZbiRYjPzr9wDoLpMnXzAjIkvtULrw+dNEF5W2qJQkzHyB6vCQh4gG76uvQJq6 st6RTT+INdG5RNbl7KW20sagQ+4KXeMonklSuBJ4kuU+acbbrSJEykPOyWujHplX kdeZg89wh0ZRZd90X4CTh6IhvU3E8zWgdr1nalpX5rEPyybXI/sahnlE2f1T7e2F LCmu6p/6Fw7gy2qOg5KM67YKqOdYhciEfrdp0lKey3aQo2Ym91aNsdYs4VuFs4tb 29jo0Jvm9IXONdb+Yixm3Thge6qv3wz0n/wyIsRgr7LX6Eqy/Yy5klF/YxWojkM= =z4Gg -----END PGP SIGNATURE----- --ruWmPaLpkm8MgdBvWKurCpDSSohUh3KgW--