From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56141) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhMQw-0007qq-5R for qemu-devel@nongnu.org; Tue, 28 May 2013 12:07:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UhMQn-0005FL-1t for qemu-devel@nongnu.org; Tue, 28 May 2013 12:07:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52680) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhMQm-0005FF-Q9 for qemu-devel@nongnu.org; Tue, 28 May 2013 12:07:24 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4SG7OQ2031638 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 28 May 2013 12:07:24 -0400 Message-ID: <51A4D63B.3040103@redhat.com> Date: Tue, 28 May 2013 10:07:23 -0600 From: Eric Blake MIME-Version: 1.0 References: <1369754856-30036-1-git-send-email-kwolf@redhat.com> <1369754856-30036-17-git-send-email-kwolf@redhat.com> In-Reply-To: <1369754856-30036-17-git-send-email-kwolf@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2KXUCSGPRXDAITMAJVHAU" Subject: Re: [Qemu-devel] [PATCH 16/16] Make qemu-io commands available in the monitor List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, lcapitulino@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2KXUCSGPRXDAITMAJVHAU Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 05/28/2013 09:27 AM, Kevin Wolf wrote: > The QMP version is flagged with a __org.qemu.debug- prefix in order to > reinforce the statement that qemu-io is for testing and debugging only,= > with no API guarantees. Correct use of naming conventions. Hmm, I wonder if the recent addition of an 'abort' action to 'transaction' should be renamed __org.qemu.debug-abort, to make it obvious that it is another case of a QMP command useful mainly for testing, and not real-life use. >=20 > The HMP version is simply called 'qemu-io' for convenience. >=20 > Signed-off-by: Kevin Wolf > --- > +++ b/hmp-commands.hx > @@ -1551,6 +1551,22 @@ Removes the chardev @var{id}. > ETEXI > =20 > { > + .name =3D "qemu-io", > + .args_type =3D "device:B,command:s", > + .params =3D "[device] \"[command]\"", > + .help =3D "run a qemu-io command on a block device", > + .mhandler.cmd =3D hmp_qemu_io, > + }, > + > +STEXI > +@item chardev_remove id > +@findex chardev_remove > + > +Removes the chardev @var{id}. Is this the right documentation? > +++ b/qapi-schema.json > @@ -3618,3 +3618,19 @@ > '*cpuid-input-ecx': 'int', > 'cpuid-register': 'X86CPURegister32', > 'features': 'int' } } > + > +## > +# @__org.qemu.debug-qemu-io-command > +# > +# Execute a qemu-io command > +# > +# @device: The block device on which the command should be executed > +# > +# @command: The command to execute > +# > +# Returns: Nothing on success > +# > +# Since: 1.6 (testing and debugging use only, no API stability) > +## > +{ 'command': '__org.qemu.debug-qemu-io-command', > + 'data': {'device': 'str', 'command': 'str'} } I would have asked that 'command' be an enum, except that we promise no API stability so there's no need to lock us into an enum that could be introspected :) This command looks fine as-is. > diff --git a/qmp-commands.hx b/qmp-commands.hx > index ffd130e..8682bea 100644 > --- a/qmp-commands.hx > +++ b/qmp-commands.hx > @@ -2932,3 +2932,31 @@ Example: > <- { "return": {} } > =20 > EQMP > + > + { > + .name =3D "__org.qemu.debug-qemu-io-command", > + .args_type =3D "device:s,command:s", > + .mhandler.cmd_new =3D qmp_marshal_input___org_qemu_debug_qemu_= io_command, > + }, > + > + > +SQMP > +__org.qemu.debug-qemu-io-command > +-------------------------------- Do we really need to have SQMP documentation of the command, or is listing of its handler sufficient? In other words, if this is debug-only, can we just leave it undocumented instead of listing an example only to declare the example non-portable? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2KXUCSGPRXDAITMAJVHAU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJRpNY7AAoJEKeha0olJ0NqUmgH/3q7Bw8Ka5Dv3INSbBTLJthg 89NBzJ1yzZ0zG9djNwkhPEd6mnCj0Rp8crubKrWjheMlgX0kBv5kS6HG9oOnxE8g TUXiT2ph9sHyy5XB86UPG6rbMuWU4WA9CjI7Jy7EGmanEAJ0y1hXOsgPW1Rowv6m vDaHcDHhpWlFSnlsOILIaibgfVBtzlLwgqb+jmleQKcJe+KfGVNKqSznjzU4awi0 Eqm1L9y5NTYsKKoCv6Su5pnQZF8jBKxHEuUkFEpjh0103FjUMSRkvO46ZmJBROAd J7giANAatFKzc0jrDh+wwAvOJ2qDXyWActcHBALSTQKYWS2TIBX9o9I2XzP8Zy8= =q8PS -----END PGP SIGNATURE----- ------enig2KXUCSGPRXDAITMAJVHAU--