From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkHQp-0006Ij-RW for qemu-devel@nongnu.org; Wed, 14 Sep 2016 17:09:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkHQo-000561-G6 for qemu-devel@nongnu.org; Wed, 14 Sep 2016 17:09:23 -0400 References: <1471625435-6190-1-git-send-email-kwolf@redhat.com> <1471625435-6190-8-git-send-email-kwolf@redhat.com> From: Eric Blake Message-ID: <156c5ff3-73c7-cefb-82b8-d0f6b8a6bb9f@redhat.com> Date: Wed, 14 Sep 2016 16:09:12 -0500 MIME-Version: 1.0 In-Reply-To: <1471625435-6190-8-git-send-email-kwolf@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="8sqttM1eVs00PkdAX3pFNC9XLirt2dtrj" Subject: Re: [Qemu-devel] [PATCH 07/10] block: Accept device model name for eject 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) --8sqttM1eVs00PkdAX3pFNC9XLirt2dtrj From: Eric Blake To: Kevin Wolf , qemu-block@nongnu.org Cc: mreitz@redhat.com, qemu-devel@nongnu.org Message-ID: <156c5ff3-73c7-cefb-82b8-d0f6b8a6bb9f@redhat.com> Subject: Re: [PATCH 07/10] block: Accept device model name for eject References: <1471625435-6190-1-git-send-email-kwolf@redhat.com> <1471625435-6190-8-git-send-email-kwolf@redhat.com> In-Reply-To: <1471625435-6190-8-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 eject to accept a qdev device name. >=20 > Signed-off-by: Kevin Wolf > --- > blockdev.c | 10 +++++++--- > hmp.c | 2 +- > qapi/block.json | 7 ++++++- > qmp-commands.hx | 8 +++++--- > 4 files changed, 19 insertions(+), 8 deletions(-) >=20 > +++ b/blockdev.c > @@ -2272,14 +2274,16 @@ void qmp_eject(const char *device, bool has_for= ce, bool force, Error **errp) > force =3D false; > } > =20 > - rc =3D do_open_tray(device, NULL, force, &local_err); > + rc =3D do_open_tray(has_device ? device : NULL, > + has_id ? id : NULL, > + force, &local_err); > if (rc && rc !=3D -ENOSYS) { > error_propagate(errp, local_err); > return; > } > error_free(local_err); > =20 > - qmp_x_blockdev_remove_medium(true, device, false, NULL, errp); > + qmp_x_blockdev_remove_medium(has_device, device, has_id, id, errp)= ; Hmm. We have to call into the underlying x- command, without breaking 'eject' which must indeed keep the deprecated 'device' parameter. So maybe that answers my question on 5 and 6. Or can we teach qmp_eject() to do the lookup now, so that it can call into qmp_x_blockdev_remove_medium() with just id, even if the user called in with device? Do we even have that information readily accessible (given a device, resolve it to an id that would work as if we were passing an id in the first place)? > +++ b/qapi/block.json > @@ -127,6 +127,8 @@ > # > # @device: The name of the device > # > +# @id: The name or QOM path of the guest device (since: 2.8) > +# Missing mention of '#optional' in both parameters, as well as the deprecation warning you had in 4/10. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --8sqttM1eVs00PkdAX3pFNC9XLirt2dtrj 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/ iQEcBAEBCAAGBQJX2bx4AAoJEKeha0olJ0NqqDcIAKUKz78faMq8SKxY/YrfOFfz 07JCpzjjtoFe4Nl7iMXashpunjjzQo0hScv4jQW1Ms59yhyj3/AcRhHshDRnXdY4 +Z6+vR65RQGH4lv/kDaJeVz7wrDeM3yxfC7srCXng580fwUlt7cdlCIKNNLR1R0D q4tPwWJIpDGG8H4TfM/AEw6cu1NtTvkWZ+Yx1dtW5mufTCaXVpMc63Qp35OTG4LU Nj8A0QU3ceJWqPLtghAB+ZU2dwwz3DWIj1oHshvRkN/CkHw9g75276eU3ySoQnfX kgqXzRKGSvAIFmZWgWTpfXl8eyqCvB8uXHLztkt+cCxsG/h+7r3mSc4agD4x6MI= =8Kr+ -----END PGP SIGNATURE----- --8sqttM1eVs00PkdAX3pFNC9XLirt2dtrj--