qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] qmp: add BLOCK_MEDIUM_EJECT event


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] qmp: add BLOCK_MEDIUM_EJECT event
Date: Fri, 27 Jan 2012 13:02:53 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0

On 01/27/2012 10:52 AM, Kevin Wolf wrote:
>  Conclusion: eject returned an error, but a few seconds later the tray opened 
and
>               the media wasn't purged. What happened here is that, the_guest_
>               opened the tray. The code in this patch would trigger the 
event, but
>               we shouldn't emit it twice if we cover eject&  change (ie. 
special case)
bdrv_dev_change_media_cb is not called because media cannot be ejected
with a locked drive. Instead bdrv_dev_eject_request is called which
doesn't emit an event.

If the guest happens to initiate an eject itself after receiving the
eject request, it calls bdrv_eject, where we can emit an event.

If we had force=true in the initial eject command, bdrv_close is called,
which in turn goes through bdrv_dev_change_media_cb where an event is
emitted.

But we still emit the eject request, and the guest will cause bdrv_eject to raise the event again.

There can always be a race with the guest setting the locked bit, so management has to do a query-block anyway after eject or change. That's why the event is not necessary when the eject is host-initiated.

Paolo




reply via email to

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