On 7 January 2016 at 19:37, Max Reitz <mre...@redhat.com> wrote: > Compare floppy disks, for which we now have a "virtual" tray status: > Whenever a medium is inserted, the "tray" is considered closed. > Otherwise, it is open. This works pretty much like a physical tray would > work; whenever the tray is closed, you cannot exchange the medium, but > when it is open, you can. > > There is only one difference to devices which actually have a tray: For > floppy disks, you cannot have a closed tray without a medium in it. > > Anyway, we can implement the same model for SD cards. I'll see to it.
It looks like sd.c is the only one which implements a change_media_cb but no is_tray_open, but it would be nice if we could implement this in the default blk_dev_is_tray_open() method rather than in the sd and floppy models (ie if I don't implement tray-open then the tray is closed if there's a medium attached, and the block backend ought to know if there's a medium attached itself already). thanks -- PMM