From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=45461 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OGeMy-00083J-HT for qemu-devel@nongnu.org; Mon, 24 May 2010 16:35:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OGeMq-0002vR-2s for qemu-devel@nongnu.org; Mon, 24 May 2010 16:35:25 -0400 Received: from fmmailgate03.web.de ([217.72.192.234]:41915) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OGeMp-0002vA-Lg for qemu-devel@nongnu.org; Mon, 24 May 2010 16:35:20 -0400 Message-ID: <4BFAE302.40806@web.de> Date: Mon, 24 May 2010 22:35:14 +0200 From: Jan Kiszka MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH v2 12/15] monitor: Add basic device state visualization References: <1f557b9feb1965a61e64f7166bcf4918bed8d0ec.1274516288.git.jan.kiszka@web.de> <4BF82895.6000706@redhat.com> <4BFAE004.6090501@codemonkey.ws> In-Reply-To: <4BFAE004.6090501@codemonkey.ws> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig28EA039C88E247D907A643D4" Sender: jan.kiszka@web.de List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Anthony Liguori , Juan Quintela , Jan Kiszka , qemu-devel@nongnu.org, Markus Armbruster , Avi Kivity , Luiz Capitulino This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig28EA039C88E247D907A643D4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Anthony Liguori wrote: > On 05/22/2010 01:55 PM, Avi Kivity wrote: >> On 05/22/2010 11:18 AM, Jan Kiszka wrote: >>> From: Jan Kiszka >>> >>> This introduces device_show, a monitor command that saves the vmstate= of >>> a qdev device and visualizes it. QMP is also supported. Buffers are c= ut >>> after 16 byte by default, but the full content can be requested via >>> '-f'. To pretty-print sub-arrays, vmstate is extended to store the st= art >>> index name. A new qerror is introduced to signal a missing vmstate. A= nd >>> it comes with documentation. >>> >>> + >>> +Dump a snapshot of the device state. Buffers are cut after 16 bytes >>> unless >>> +a full dump is requested. >>> + >>> +Arguments: >>> + >>> +- "path": the device's qtree path or unique ID (json-string) >> >> This may be ambiguous. >> >>> +- "full": report full state (json-bool, optional) >> >> Is this needed for QMP? The client can always truncate it to any leng= th. >> >>> + >>> +Schema of returned object: >>> + >>> +{ "device": json-string, "id": json-string, "fields" : [ >>> field-objects ] } >>> + >>> +The field object array may be empty, otherwise it consists of >>> + >>> +{ "name": json-string, "size": json-int, "elems": [ element-objects = ] } >>> + >>> +"size" describes the real number of bytes required for a binary >>> representation >>> +of a single field element in the array. The actually transfered >>> amount may be >>> +smaller unless a full dump was requested. >> >> This converts the entire qdev tree into an undocumented stable >> protocol (the qdev paths were already in this state I believe). This >> really worries me. >=20 > N.B. the association with qdev is only in identifying the device. The > contents of the device's state are not part of qdev but rather part of > vmstate. vmstate is something that we already guarantee to be stable > since that's required for live migration compatibility. In contrast to save/loadvm, device_show does not provide a backward-compatible output. Not only field names can change (as a result of internal refactoring), fields may even disappear, new ones may pop up. vmstate makes this transparent for reading of old states, but not for visualization. That said, I see no use case yet that would justify the effort for making state dumps as stable as vmstates. Jan --------------enig28EA039C88E247D907A643D4 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.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkv64wUACgkQitSsb3rl5xQquwCeI7Po6JQVwgpYFdi9uiafOqtQ S/UAoMX2dsRr5cItZhLHsmQbyFwG0Zbu =akwH -----END PGP SIGNATURE----- --------------enig28EA039C88E247D907A643D4--