Received: from eggs.gnu.org ([2001:4830:134:3::10]:43248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkH7O-0006Bu-V4 for qemu-devel@nongnu.org; Wed, 14 Sep 2016 16:49:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkH7M-0007eT-LN for qemu-devel@nongnu.org; Wed, 14 Sep 2016 16:49:17 -0400 References: <1471625435-6190-1-git-send-email-kwolf@redhat.com> <1471625435-6190-5-git-send-email-kwolf@redhat.com> From: Eric Blake Message-ID: Date: Wed, 14 Sep 2016 15:49:08 -0500 MIME-Version: 1.0 In-Reply-To: <1471625435-6190-5-git-send-email-kwolf@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="UH7laKrTTQRBUbEBHEvXWAHpeDUCTGoFQ" Subject: Re: [Qemu-devel] [PATCH 04/10] block: Accept device model name for blockdev-open/close-tray List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-block@nongnu.org Cc: mreitz@redhat.com, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --UH7laKrTTQRBUbEBHEvXWAHpeDUCTGoFQ From: Eric Blake To: Kevin Wolf , qemu-block@nongnu.org Cc: mreitz@redhat.com, qemu-devel@nongnu.org Message-ID: Subject: Re: [PATCH 04/10] block: Accept device model name for blockdev-open/close-tray References: <1471625435-6190-1-git-send-email-kwolf@redhat.com> <1471625435-6190-5-git-send-email-kwolf@redhat.com> In-Reply-To: <1471625435-6190-5-git-send-email-kwolf@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 08/19/2016 11:50 AM, Kevin Wolf wrote: > In order to remove the necessity to use BlockBackend names in the > external API, we want to allow qdev device names in all device related > commands. >=20 > This converts blockdev-open/close-tray to accept a qdev device name. >=20 > Signed-off-by: Kevin Wolf > --- > blockdev.c | 60 +++++++++++++++++++++++++++++++++++++++-----= -------- > qapi/block-core.json | 14 ++++++++---- > qmp-commands.hx | 12 +++++++---- > 3 files changed, 63 insertions(+), 23 deletions(-) >=20 > +++ b/qapi/block-core.json > @@ -2316,7 +2316,9 @@ > # to it > # - if the guest device does not have an actual tray > # > -# @device: block device name > +# @device: block device name (deprecated, use @id instead) > +# > +# @id: the name or QOM path of the guest device (since: 2.8) Wish there were an easier way to write mutually-exclusive pairs in JSON, but without that, your approach is fine. > +++ b/qmp-commands.hx > @@ -4277,7 +4277,7 @@ EQMP > =20 > { > .name =3D "blockdev-open-tray", > - .args_type =3D "device:s,force:b?", > + .args_type =3D "device:s?,id:s?,force:b?", > .mhandler.cmd_new =3D qmp_marshal_blockdev_open_tray, > }, Will conflict with Marc-Andre's work to remove qmp-commands.hx; but we can figure it out based on what merges first. > =20 > @@ -4302,7 +4302,9 @@ which no such event will be generated, these incl= ude: > =20 > Arguments: > =20 > -- "device": block device name (json-string) > +- "device": block device name (deprecated, use @id instead) > + (json-string, optional) > +- "id": the name or QOM path of the guest device (json-string, optiona= l) > - "force": if false (the default), an eject request will be sent to th= e guest if > it has locked the tray (and the tray will not be opened imm= ediately); > if true, the tray will be opened regardless of whether it i= s locked Are there any example code snippets that should be updated alongside this? If not, should we be thinking of adding an example? But I can live with this patch as an incremental improvement, even if we decide we want more as a followup based on my question above, so: Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --UH7laKrTTQRBUbEBHEvXWAHpeDUCTGoFQ 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/ iQEcBAEBCAAGBQJX2bfEAAoJEKeha0olJ0NqZ5QH/Al8IejTKq9b97YPDxkfrUX2 XEqFjmN+hGaTeG+VpI7PAplCdyJkGmNG3NvxmfJD+Bax1GSVkFBbj7dzrqBZzTcG w1nCbRUXcsxcrOCz7AhQGLTY9zeF9KNV9GHFwdt54OQNyEuoanXtha9J0A93tE2y Zk4ekrUJG1QiwTqfnvfZW9QA5owljNf5kKuDK/WBfgf0Iisw2ev8coCvgkyZziRS 2tuRiY4lE2tOI13ETs5dOCBGYx7u+2kS00rliuXsluF/ycikUcKaiZ6O1HOrl1w8 phlPhc1S4LiheLm+/0wxmzHM1Jsx8C+r2CWL70+HFg6rg8EljCv98LxlWEN+cYs= =cdzC -----END PGP SIGNATURE----- --UH7laKrTTQRBUbEBHEvXWAHpeDUCTGoFQ--