On Mon, 6 Dec 2021 at 12:35, Markus Armbruster <arm...@redhat.com> wrote: > Philippe Mathieu-Daudé <f4...@amsat.org> writes: > > I guess a already asked this once but don't remember now... What is the > > point of creating a SD card without drive? Is this due to the old design > > issue we hotplug the drive to the SD card and not the SD card on the SD > > bus? > > Device model "sd-card" implements BlockdevOps method change_media_cb(). > This menas it models a device with a removable medium. No drive behaves > like no medium. I guess it's an SD card reader.
No, device sd-card really is the SD card -- the protocol between the SD controller device and the sd-card device is (a slightly abstracted version of) the protocol that goes between the card and the controller in hardware. I think the reason it's implemented as a "device with a removable medium" is historical -- back in 2007 that was the only way to support runtime ejecting and insertion. We'd implement it differently today, but we've wanted to preserve the user-facing compatibility of how the monitor commands for ejecting and inserting an sd card work. (Side note, the initial sd implementation actually tells the block layer that it's BDRV_TYPE_FLOPPY as a "reasonable approximation"...) -- PMM