qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 6/8] block: add eject request callback


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 6/8] block: add eject request callback
Date: Sat, 29 Oct 2011 09:46:50 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110930 Thunderbird/7.0.1

On 10/28/2011 07:21 PM, Kevin Wolf wrote:
>  -    if (!force&&  !bdrv_dev_is_tray_open(bs)
>  -&&  bdrv_dev_is_medium_locked(bs)) {
>  -        qerror_report(QERR_DEVICE_LOCKED, bdrv_get_device_name(bs));
>  +    if (bdrv_dev_is_medium_locked(bs)&&  !bdrv_dev_is_tray_open(bs)) {
>  +        bdrv_dev_eject_request(bs, force);
>  +        if (!force) {
>  +            qerror_report(QERR_DEVICE_LOCKED, bdrv_get_device_name(bs));
>  +        }
>            return -1;
>        }
>        bdrv_close(bs);
Now force doesn't force any more. It avoids the error message, but
doesn't forcefully close the BlockDriverState any more. Intentional? If
so, why is it a good idea?

In theory the guest OS should eject the disk itself. However, force does unlock the disk so that: 1) two ejects will have the desired effect; 2) force eject followed by change will work even with the tray locked, unlike before this series.

Paolo




reply via email to

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