From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpcMv-0001Uw-2d for qemu-devel@nongnu.org; Fri, 23 Oct 2015 09:26:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZpcMu-0006Xa-BG for qemu-devel@nongnu.org; Fri, 23 Oct 2015 09:26:53 -0400 Date: Fri, 23 Oct 2015 15:26:44 +0200 From: Kevin Wolf Message-ID: <20151023132644.GC3797@noname.redhat.com> References: <1445270025-22999-1-git-send-email-mreitz@redhat.com> <1445270025-22999-29-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1445270025-22999-29-git-send-email-mreitz@redhat.com> 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: Max Reitz Cc: Alberto Garcia , qemu-block@nongnu.org, John Snow , qemu-devel@nongnu.org, Markus Armbruster , Stefan Hajnoczi 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(+) > + bs = blk_bs(blk); > + if (bs) { > + aio_context = bdrv_get_aio_context(bs); > + aio_context_acquire(aio_context); > + > + if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_EJECT, errp)) { > + goto out; > + } 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. Kevin