Due to the design of qemu (no rescan later) we need to restart the qemu process after the upgrade.
# Upgrade to Proposed (in other window)
# then start guest again and then attach the device (now working)
virsh attach-device testguest usb.xml
=> Verified
Note: since you likely came here for having issues with USB passthrough. While working on this I found related issues, please check the following bugs to be sure you not just have to add a config or so:
- bug 1727311
- bug 1727313
root@ubuntu:~#
root@ubuntu:~# virsh define testguest.xml
Domain testguest defined from testguest.xml
root@ubuntu:~# virsh start testguest
Domain testguest started
root@ubuntu:~# cat <<EOF >usb.xml
> <hostdev mode='subsystem' type='usb' managed='yes'>
> <source>
> <vendor id='0x046d'/>
> <product id='0x0825'/>
> </source>
> </hostdev>
> EOF
root@ubuntu:~# virsh attach-device testguest usb.xml
error: Failed to attach device from usb.xml
error: internal error: unable to execute QEMU command 'device_add': failed to find host usb device 2:10
Denies while USB was initialized the first time: 0.712:48) : apparmor="STATUS" operation= "profile_ replace" profile= "unconfined" name="libvirt- deadbeef- dead-beef- dead-beefdeadbe ef" pid=6668 comm="apparmor_ parser" 0.715:49) : apparmor="DENIED" operation="open" profile= "libvirt- deadbeef- dead-beef- dead-beefdeadbe ef" name="/ run/udev/ data/c189: 133" pid=6638 comm="qemu- system- x86" requested_mask="r" denied_mask="r" fsuid=64055 ouid=0 0.715:50) : apparmor="DENIED" operation="open" profile= "libvirt- deadbeef- dead-beef- dead-beefdeadbe ef" name="/ run/udev/ data/c189: 256" pid=6638 comm="qemu- system- x86" requested_mask="r" denied_mask="r" fsuid=64055 ouid=0 0.715:55) : apparmor="DENIED" operation="open" profile= "libvirt- deadbeef- dead-beef- dead-beefdeadbe ef" name="/ run/udev/ data/c189: 129" pid=6638 comm="qemu- system- x86" requested_mask="r" denied_mask="r" fsuid=64055 ouid=0 0.715:57) : apparmor="DENIED" operation="open" profile= "libvirt- deadbeef- dead-beef- dead-beefdeadbe ef" name="/ run/udev/ data/c189: 0" pid=6638 comm="qemu- system- x86" requested_mask="r" denied_mask="r" fsuid=64055 ouid=0
[ 1046.984694] audit: type=1400 audit(150892628
[ 1046.987757] audit: type=1400 audit(150892628
[ 1046.987831] audit: type=1400 audit(150892628
[ 1046.988143] audit: type=1400 audit(150892628
[ 1046.988263] audit: type=1400 audit(150892628
Due to the design of qemu (no rescan later) we need to restart the qemu process after the upgrade.
# Upgrade to Proposed (in other window)
# then start guest again and then attach the device (now working)
virsh attach-device testguest usb.xml
=> Verified
Note: since you likely came here for having issues with USB passthrough. While working on this I found related issues, please check the following bugs to be sure you not just have to add a config or so:
- bug 1727311
- bug 1727313