usb passthrough not resetting on host after vm shutdown if started with -daemonize
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Below is the full Qemu command used to launch the VM. Have been using this same setup since Qemu 2.12, plus a couple of cherry picked patch commits fixing ide-hd and e1000e in Windows guests. Both sets of patches have now been merged to 3.0, so decided to update to 3.0.
The VM launches and runs fine, but after shutting down, the usb devices that are passed through from the host (keyboard, mouse) do not work until unplugged and plugged in again. Have narrowed this down to the -daemonize -pidfile arguments.. if those lines are removed, usb devices work in the host again right away after VM shutdown.
CPU: Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz
OS: Linux dev 4.18.6-arch1-1-ARCH #1 SMP PREEMPT Wed Sep 5 11:54:09 UTC 2018 x86_64 GNU/Linux
Thank you for looking into this!
#!/usr/bin/env bash
echo vfio-pci > /sys/bus/
echo 0000:04:00.0 > /sys/bus/
echo 0000:04:00.0 > /sys/bus/
echo > /sys/bus/
/usr/bin/
-name winnt \
-daemonize \
-pidfile /run/vms/
-boot menu=on \
-drive if=pflash,
-drive if=pflash,
-machine pc-q35-
-nodefaults \
-cpu host,kvm=
-accel kvm \
-smp 4,sockets=
-m 16G \
-nic bridge,
-device vfio-pci,
-device vfio-pci,
-vga none \
-display none \
-monitor none \
-blockdev raw,node-
-device ide-hd,
-blockdev raw,node-
-device ide-hd,
-device vfio-pci,
-device qemu-xhci \
-device usb-host,
-device usb-host,
-device usb-host,
echo 0000:04:00.0 > /sys/bus/
echo 0000:04:00.0 > /sys/bus/
Changed in qemu: | |
status: | New → Fix Released |
To clarify, are the problematic USB passthrough devices these:
-device usb-host, vendorid= 0x04d9, productid= 0x0171 \ vendorid= 0x1532, productid= 0x005c \ vendorid= 0x1b1c, productid= 0x0c09
-device usb-host,
-device usb-host,
or this:
-device vfio-pci, host=04: 00.0 \
Without knowing what the vfio-pci devices are (assuming 1:00.x is GPU+audio), I don't know if passthrough is being used as a colloquial for device assignment or if the issue is really with the usb-host devices.