* -hda fat: vs "Block node is read-only" error
@ 2025-12-10 10:02 Peter Maydell
0 siblings, 0 replies; only message in thread
From: Peter Maydell @ 2025-12-10 10:02 UTC (permalink / raw)
To: QEMU Developers, Qemu-block; +Cc: Kevin Wolf, Hanna Reitz
(Prompted by a user query on IRC.)
In our documentation for "virtual FAT disk images"
https://www.qemu.org/docs/master/system/images.html#virtual-fat-disk-images
we say that you can use a command line like:
qemu-system-x86_64 linux.img -hdb fat:/my_directory
to get a disk image with (default) read-only access to the host
filesystem. However, if you try this it gives a warning and an error:
$ ./build/x86-tgts/qemu-system-x86_64 -hdb fat:/tmp/zz9
WARNING: Image format was not specified for 'json:{"fat-type": 0,
"dir": "/tmp/zz9", "driver": "vvfat", "floppy": false, "rw": false}'
and probing guessed raw.
Automatically detecting the format is dangerous for raw
images, write operations on block 0 will be restricted.
Specify the 'raw' format explicitly to remove the restrictions.
qemu-system-x86_64: Block node is read-only
The first of these seems nonsensical -- why is this fake FAT disk
image going through the "auto-detect format" code ? The "image"
the vvfat code presents to the rest of the block system should
always be raw by definition, I would have thought.
The second of them is a fatal error, and means the command line as
we have documented it just doesn't work. Specifying "fat:rw:/dir"
works because then the FAT backend is read-write -- but how should
the user tell QEMU "no, I really do want just read access" here ?
Presumably at some point we added some extra validation on
whether a block backend is read-only, and never updated the
FAT disk image docs accordingly ?
thanks
-- PMM
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-12-10 10:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-10 10:02 -hda fat: vs "Block node is read-only" error Peter Maydell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).