qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v7 28/39] blockdev: Add blockdev-open-tray


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH v7 28/39] blockdev: Add blockdev-open-tray
Date: Fri, 23 Oct 2015 16:26:02 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

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 <address@hidden>
>> ---
>>  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.

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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]