From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34135) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpdIL-00086w-92 for qemu-devel@nongnu.org; Fri, 23 Oct 2015 10:26:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZpdIK-0002yf-B4 for qemu-devel@nongnu.org; Fri, 23 Oct 2015 10:26:13 -0400 References: <1445270025-22999-1-git-send-email-mreitz@redhat.com> <1445270025-22999-29-git-send-email-mreitz@redhat.com> <20151023132644.GC3797@noname.redhat.com> From: Max Reitz Message-ID: <562A437A.1040709@redhat.com> Date: Fri, 23 Oct 2015 16:26:02 +0200 MIME-Version: 1.0 In-Reply-To: <20151023132644.GC3797@noname.redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="BdE0J1DXPqutkoIcpKlGnWgKT5pTduPXi" Subject: Re: [Qemu-devel] [PATCH v7 28/39] blockdev: Add blockdev-open-tray List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Alberto Garcia , qemu-block@nongnu.org, John Snow , qemu-devel@nongnu.org, Markus Armbruster , Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --BdE0J1DXPqutkoIcpKlGnWgKT5pTduPXi Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 23.10.2015 15:26, Kevin Wolf wrote: > Am 19.10.2015 um 17:53 hat Max Reitz geschrieben: >> Signed-off-by: Max Reitz >> --- >> blockdev.c | 49 +++++++++++++++++++++++++++++++++++++++++++= ++++++ >> qapi/block-core.json | 23 +++++++++++++++++++++++ >> qmp-commands.hx | 39 +++++++++++++++++++++++++++++++++++++++ >> 3 files changed, 111 insertions(+) >=20 >> + bs =3D blk_bs(blk); >> + if (bs) { >> + aio_context =3D bdrv_get_aio_context(bs); >> + aio_context_acquire(aio_context); >> + >> + if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_EJECT, errp)) { >> + goto out; >> + } >=20 > Is this blocker really for protecting against opening the tray? I think= > the BDS shouldn't care about whether the guest can access it. So it's > probably more about preventing a bdrv_close() from happening, i.e. it > would be relevant only for the blockdev-remove-medium command. I don't think so. I intended blockdev-open-tray to be what it is for real hardware: Opening the tray severs all the links between the medium and software trying to access the drive. blockdev-remove-medium should never fail if the tray is already open, since it would never fail in real life. By the way, that's the reason why I generally preferred blk_is_available() over blk_is_inserted() in this series. Max --BdE0J1DXPqutkoIcpKlGnWgKT5pTduPXi 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 iQEcBAEBCAAGBQJWKkN6AAoJEDuxQgLoOKytA4UH/jT1j+7pXb6SafCWjy+Di+Vv 1cEt/uX03bSM+EER7CXq1cm94xKytOAcNW89WP634mxoiNAhmkgr0hFeKyT3MPTL MQqs2TXSO0KbsfY6GHG+HVV/T8iHAy7kbGl+3gQA/gCcNyh8i2PJ4oKflpwJhOaY MaVtt46PXSGFL6qva4eaW9nZDXNyAOp7jrGTO0gV4DJTozWD+AEmZu7ZEMW+ZLRe VnbsZXx7sAcbZDfb7qqY+cuyDecJs2Sbl7RAj0QbsXJbjbRpsouqXiYQu3Ns1TKE lW7EVZZ/k7Q203igL6Gw7spwG6XIta2S60Y4mtu79Hb1xxHR8uFGJAWP/j+oV8s= =SEBw -----END PGP SIGNATURE----- --BdE0J1DXPqutkoIcpKlGnWgKT5pTduPXi--