make the virsh run after the udev script to fix a "failed to find host usb device" error#2
make the virsh run after the udev script to fix a "failed to find host usb device" error#2badjware wants to merge 1 commit intoolavmrk:masterfrom
Conversation
…t usb device" error
|
please check this solution https://github.com/daybat/usb-libvirt-hotplug |
|
@badjware I am baffled why this works. It's needed if I unplug and replug the device, but works on first insertion after I start the VM. sleep 5 wouldn't fix the problem, but this did. Could you exaplain? |
hi. what is the problem? |
|
@badjware Thank you very much. You patch fixes the issue. |
|
If your vm is configured to use a host usb device, these devices will automatically be attached to your vm when you boot it. Then, if you physically unplug and replug your device or plug in a new device, the vm will not pick the device and it will be left associated to the host. This is what this script addresses. Look up udev if you wish to learn more on how the script works. I do not remember why Hope this help. |
virsh was throwning the following error:
558: error : qemuMonitorJSONCheckError:394 : internal error: unable to execute QEMU command 'device_add': failed to find host usb deviceRunning the scipt manually was working fine. After some testing, it seemed that the usb device was not fully available yet when the udev script was running. Runnning virsh slightly after udev using the
atcommand fixed the issue.