Skip to content

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

  1. virt-install --osinfo linux2022 --disk none --filesystem "/tmp,host,driver.type=virtiofs" --memorybacking "source.type=memfd,access.mode=shared" --print-xml > /tmp/foo.xml
  2. virsh define /tmp/foo.xml --validate FAILS
  3. virsh define /tmp/foo.xml WORKS
  4. 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>
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information