> 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.