From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36613) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhfK0-0000Eb-Nq for qemu-devel@nongnu.org; Wed, 29 May 2013 08:17:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UhfJv-0007Ie-VU for qemu-devel@nongnu.org; Wed, 29 May 2013 08:17:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49307) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uhf7y-0003dG-FQ for qemu-devel@nongnu.org; Wed, 29 May 2013 08:05:14 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4TC5D6I026863 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 29 May 2013 08:05:13 -0400 Message-ID: <51A5EEF8.2040707@redhat.com> Date: Wed, 29 May 2013 06:05:12 -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> <51A4D63B.3040103@redhat.com> <20130529081341.GB3521@dhcp-200-207.str.redhat.com> In-Reply-To: <20130529081341.GB3521@dhcp-200-207.str.redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2TXDBANUHFVMMFEOLVNIW" 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) ------enig2TXDBANUHFVMMFEOLVNIW Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 05/29/2013 02:13 AM, Kevin Wolf wrote: > Am 28.05.2013 um 18:07 hat Eric Blake geschrieben: >> On 05/28/2013 09:27 AM, Kevin Wolf wrote: >>> The QMP version is flagged with a __org.qemu.debug- prefix in order t= o >>> reinforce the statement that qemu-io is for testing and debugging onl= y, >>> 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 > Makes sense to me. >=20 > But first I'd like to get Luiz's ack for this, because I think I'm the > first one to use an __org.qemu prefix, and I'm the first one trying to > introduce a QMP command without API stability. qom-get/qom-set is somewhat of an unstable API (not that the parameters of the call will change, but that the underlying qom model is not locked down, and therefore you cannot blindly rely on a qom command that worked in one version to continue working in future versions). [Hmm, do we have a good way to introspect the qom model?] But yes, this is indeed a different class of unstable interface, and worth agreeing that we have best practice in mind before committing to it= =2E >>> +{ '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 n= o >> API stability so there's no need to lock us into an enum that could be= >> introspected :) This command looks fine as-is. >=20 > Wouldn't even work because the command includes parameters and things. > This is really what you would type on the qemu-io command line. So a > typical example might look like: >=20 > { "execute": "__org.qemu.debug-qemu-io-command", "arguments": > { "device": "ide0-hd0", "command": "write -P 0x12 4M 512k" } } >=20 > There's nothing structured about it, but for testing and debugging this= > should be good enough. I would suggest that you consider using 'command':['str'], so that at least you have structure that allows you to pass separate arguments (and thus pass an argument with spaces in the future, should the need arise): { "execute": "__org.qemu.debug-qemu-io-command", "arguments": { "device": "ide0-hd0", "command": [ "write", "-P", "0x12", "4M", "512k" ] } } --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2TXDBANUHFVMMFEOLVNIW 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/ iQEcBAEBCAAGBQJRpe74AAoJEKeha0olJ0NqwKIH/17VJShM7f/qfD6UG9/r4gy6 zkmk8126HnbPHsH1MUPzWY3qizAoO6V5nW0SBmtpya+VZ3ltnvnUhrPH0tt4ZDbP z9T/SXJhfBtLhYAWnBjDvLjjCmSu8OSrOZ2QSN5sv4n1F8lTy9MMjTKIvIdwjfOr hWu8D4+CDEY1l6vpbIxXtmDZoGr3Wz/JAd36DWlIXs2WyiPoggXaDeV+pEOJoPlV a2UpIuYEgomsf0ct31bN5SMXFgwXrUZr42xJDsYts1iIoUEkBQn198RRPBkFwObD h4sAwhx83F3YSneWJWmigq8hBvht8FBed+fIDoO/DMznvwI5lzku1xy+CAaqOlM= =Yqnf -----END PGP SIGNATURE----- ------enig2TXDBANUHFVMMFEOLVNIW--