<div dir="ltr">Didn't know libvirt was capable of unbinding devices on its own, good to know, i'm gonna try this and if i manage to make it work i don't have any reason to bother myself more with this. (note that i don't use virt-manager since you advise me to use libvirt directly)<br>Though the usb card will only be use by the vm, i have more than enough usb ports on my backpanel.<br><br>Tried the gpu method by adding the id of the device in modprobe.d after gpu's ids but it didn't work.<br><br>I paid it 50euros :(<br>Thanks for the explanations alex<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">2016-01-15 18:59 GMT+01:00 Alex Williamson <span dir="ltr"><<a href="mailto:alex.williamson@redhat.com" target="_blank">alex.williamson@redhat.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">A couple comments, first, boot time pre-binding to vfio-pci is really<br>
only necessary for devices where the native host drivers behave poorly<br>
if you take the device away from them later.  This is why we do it for<br>
GPUs and their companion sound device, host GPU drivers don't like to<br>
give up the device, it plays poorly with any sort of graphics on the<br>
host, and sequestering the audio device prevents host tools from<br>
getting confused (and there are some bugs in the audio driver limiting<br>
number of attach/detach cycles iirc).<br>
<br>
For anything else, you can dynamically unbind the device from the host<br>
driver, bind it to vfio while the VM is running, and give it back to<br>
the host on shutdown.  libvirt will do this automatically for you if<br>
your XML sets managed='yes' for the <hostdev> device.  This is the default, so if you use virt-manager to add the device, just select Add Hardware -> PCI Host Device -> select device -> Finish.  Done.  If for some reason you don't want the device flopping back and forth between host and guest, just run 'virsh nodedev-detach pci_0000_xx_yy_z' at bootup where xx_yy_z is the PCI bus (xx), device (yy), and function (z) numbers, the same as in lspci.  You can adopt some of the GPU methods for doing this if you want it to happen earlier as well, there are lots of ways to do this with modprobe.d (install options, softdep, etc..)<br>
<br>
Finally, yes I've seen OVMF hang with some crappy USB controllers.  I'm<br>
not sure if it's dependent on the devices attached or the controller<br>
itself, but cheaper isn't always better when it comes to selecting<br>
devices to use with device assignment.  Thanks,<br>
<br>
Alex<br>
</blockquote></div><br></div>