XML validation of <filesystem type='mount'> with reordered sub-elements fails
Software environment
- Operating system: Arch Linux
- Architecture: x86_64
- kernel version: 5.19.13
- libvirt version: 8.8.0
- Hypervisor and version: QEMU 7.1.0
Description of problem
This is a only a minor issue. Please see https://github.com/virt-manager/virt-manager/issues/437 for background.
Steps to reproduce
- virt-install --osinfo linux2022 --disk none --filesystem "/tmp,host,driver.type=virtiofs" --memorybacking "source.type=memfd,access.mode=shared" --print-xml > /tmp/foo.xml
- virsh define /tmp/foo.xml --validate FAILS
- virsh define /tmp/foo.xml WORKS
- virt-xml-validate /tmp/foo.xml FAILS
Additional information
- It seems odd that libvirt won't validate the domain XML but will accept it otherwise
- The order of the XML nodes matters. This fails:
<filesystem type="mount">
<source dir="/tmp"/>
<target dir="host"/>
<driver type="virtiofs"/>
</filesystem>
- This works:
<filesystem type="mount">
<driver type="virtiofs"/>
<source dir="/tmp"/>
<target dir="host"/>
</filesystem>