[9.3 Regression] Default bus for keyboard/mouse

Software environment

  • Operating system: AlmaLinux 9.3
  • Architecture: x86_64
  • kernel version: 5.14.0-284.30.1.el9_2.x86_64
  • libvirt version: libvirt-9.5.0-8.el9.x86_64
  • Hypervisor and version: qemu-kvm-8.0.0-16.el9_3.1.alma.1.x86_64

Description of problem

libvirt 9.3 introduced a regression around the default bus of mouse/keyboard devices. More specifically this commit: c4bc4d3b

Previously when a mouse/keyboard device was added without a bus (for example just <input type="mouse"/>), the bus would default to ps2 upon libvirt's processing of the config. After the commit above, the result is now <input type='mouse' bus='default'/> which is obviously not valid.

I will submit a PR with a fix which will make it easy to see the regression in code.

Steps to reproduce

wget https://repo.almalinux.org/almalinux/9.3/cloud/x86_64/images/AlmaLinux-9-GenericCloud-latest.x86_64.qcow2 -O /var/lib/libvirt/images/AlmaLinux-9-GenericCloud-latest.x86_64.qcow2

virt-install --name libvirtd-bug-alma9 --memory 8192 --vcpus 4 --disk /var/lib/libvirt/images/AlmaLinux-9-GenericCloud-latest.x86_64.qcow2 --import --os-variant almalinux9 --noautoconsole

cat << EOF > mouse.xml
<input type='mouse'/>
EOF

virsh attach-device libvirtd-bug-alma9 --file mouse.xml --current

Output:

# virsh attach-device 12 --file mouse.xml --current
error: Failed to attach device from mouse.xml
error: unsupported configuration: unknown input bus type 'default'

Additional information

N/A

Edited by Jonathan Wright
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information