On 04/12/2007, Paul Brook <[EMAIL PROTECTED]> wrote: > On Tuesday 04 December 2007, andrzej zaborowski wrote: > > On 04/12/2007, Paul Brook <[EMAIL PROTECTED]> wrote: > > > > Log message: > > > > Always create an SD bdrv, so that PXA and OMAP boards can boot > > > > with no card inserted again. Eventually SD, CDROM and floppy should > > > > all be registered conditionally depending on machine. > > > > > > This seems the wrong way to solve this problem. The SD emulation should > > > be able to cope with no device being present. > > > > The bdrv's represent the concept of "drive" rather than "media", and > > also in the case the bdrv must be present whenever there is a SD slot, > > not an SD card (so that monitor command change and eject can be used). > > I agree that not all machines have an SD slot, as not all machines > > have a cd-rom drive or floppy drive. > > Right, but I think you're going in the wrong direction. Most scsi interfaces > do support hotplug of devices. For USB mass storage the whole controller is > hotplug. Pre-allocating all possible devices simply doesn't scale.
We don't pre-allocate all possible devices, only the "drives" which are integral part of the machine (as is the case of the SD slot in a Zaurus, soldered to the PCB). New bdrv's can still be added and removed in runtime for hotplugged devices and I have no intetion to change that. If you want to use the hotplugging-like mechanism for inserting removable media like SD, CD or floppy, that would mean scrapping the whole bdrv_is_removable(), bdrv_is_inserted(), bdrv_media_changed() api. Regards