Missing documentation `disk type='dir'`
Description of problem
I was looking for a way to get a folder (btrfs subvolume) from another server mounted as a disk of a KVM VM. I had little hope for this working, but when reading the documentation I found the disk type "dir", but the documentation didn't elaborate on it further. When looking through this repository I found one example (but still no documentation or elaboration neither about how or when to use it nor about how exactly it works). Also when I looked at this example I noticed that the driver name='qemu' type='fat'
is currently not mentioned in the documentation at all.
Also from playing around with this example a bit, I noticed that it does only work as read-only. I was looking for a read-write alternative, but that's probably very hard to emulate...
- Example: https://gitlab.com/libvirt/libvirt/-/blob/master/tests/qemublocktestdata/xml2json/dir-fat-cache.xml
- Documentation: https://libvirt.org/formatdomain.html#hard-drives-floppy-disks-cdroms
Edit: Also the restriction to read-only (removing the read-only attribute throws an error when saving via virt-manager), is probably outdated (soonish), as the QEMU documentation mentions read-write being in beta. https://www.qemu.org/docs/master/system/images.html#virtual-fat-disk-images
Additional information
<disk type='dir' device='disk'>
<driver name='qemu' type='fat' cache='directsync'/>
<source dir='/var/somefiles'>
<privateData>
<nodenames>
<nodename type='storage' name='node-s'/>
<nodename type='format' name='node-f'/>
</nodenames>
</privateData>
</source>
<target dev='vda'/>
<readonly/>
</disk>