From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47839) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkS8i-00042S-1Y for qemu-devel@nongnu.org; Thu, 15 Sep 2016 04:35:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkS8h-0002Gv-07 for qemu-devel@nongnu.org; Thu, 15 Sep 2016 04:35:23 -0400 Date: Thu, 15 Sep 2016 10:35:14 +0200 From: Kevin Wolf Message-ID: <20160915083514.GA4726@noname.redhat.com> References: <1471625435-6190-1-git-send-email-kwolf@redhat.com> <1471625435-6190-5-git-send-email-kwolf@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jRHKVT23PllUwdXP" Content-Disposition: inline In-Reply-To: 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: Eric Blake Cc: qemu-block@nongnu.org, mreitz@redhat.com, qemu-devel@nongnu.org --jRHKVT23PllUwdXP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Am 14.09.2016 um 22:49 hat Eric Blake geschrieben: > 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 >=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) >=20 > Wish there were an easier way to write mutually-exclusive pairs in JSON, > but without that, your approach is fine. >=20 > > +++ 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, > > }, >=20 > Will conflict with Marc-Andre's work to remove qmp-commands.hx; but we > can figure it out based on what merges first. >=20 > > =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 >=20 > Are there any example code snippets that should be updated alongside > this? If not, should we be thinking of adding an example? We could probably update the examples to avoid deprecated fields in them. Though the old examples still work, so is it worth changing all examples if we're goig to remove qmp-commands.hx anyway? Or will the examples be moved to somewhere else? Kevin --jRHKVT23PllUwdXP Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJX2l1CAAoJEH8JsnLIjy/W144P/i94Nodq77mOtsu/QhsBVC5I 7mWvo7qc4JxoJr6I0jz/UoKt5GKONEklwPYT3pwD2YRZpl9xCvjQ3RAW5sAcTTh6 goz8eCs8P30Eg7c/u5IZ+YQGc32xDMrs2J4DUZTCQHksw6SA45sucE17amGHCTV6 W9++evgUUOB2THQwEZTWVrQcmy/5MyfBzOeIqwMoMCEcHYY6r+zTHmJeowP5Ws5l ZtLhOzxKSmvxIP7fludKnXrFNpMZ82GGL/+aRoGqkMfG+DgigovR9Aa3W+ravoNT r6/KaJfL8GIWbyL2rYqk3M1F0kEYTy1Df1BKGsdjAcl/es3vwIMXelgOzILjCPCD fhXOMDz4cQZ+oyYmN2GBf1lGNb8+b3PzAvYyAJWCzKBT393BKKPf0xhMmuzFCnOC 8QNb1a9MyV/pD9Tov7QkYZwQgwSbsbhKpVsnsQ5vzMh7F9hu693Gs9XIqr82XMRQ htyneebEHabvO+2Hk2KJtCak1vUbe40jEkvq5MrG+B2GSKHdc2TXHAFUzWsxVUKo GS9T6h2lWV/on7FNooBx3YOPfbeFqjVnLYxRJVveaE/YBlptmsMGV3eMvPN/Wmbn PhD47RFcOBtK931gdRmjJo78zK7KYyLnIjp8WOKWK1HUjoU+5Vra3EY3vejQcYgF 5p+F9r9GAqzXCoOV+LFX =taRG -----END PGP SIGNATURE----- --jRHKVT23PllUwdXP--