On Mon, 25 Jan 2021 at 16:03, Philippe Mathieu-Daudé <phi...@redhat.com> wrote: > The problem is when emulating devices such NOR Flash (parallel mapping > or SD cards) we expect the block driver being a plain file (either "raw" > format or another) but a "regular" file. When an user passes something > else like a block device, odd things happen. > > Well, I guess I self-restricted my question to device emulation. So > in the cases mentioned I would like to add a check in sd_realize()/ > pflash_cfi0?_realize() for regular file when a block drive is provided. > > Description of problematic user case: > > * -pflash /dev/sda > * -sd /dev/mmcblk0 > > User runs emulation on top of hardware (maybe like passthru?), and > expect underlying block to be in correct state out of QEMU.
It would certainly be nice if these cases worked (AIUI they do for IDE/SCSI disk emulation, right?). So what goes wrong in the SD card emulation case? thanks -- PMM