[vfio-users] passthrough usb controler pci-e card ?

thibaut noah thibaut.noah at gmail.com
Sat Jan 16 10:30:36 UTC 2016


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)
Though the usb card will only be use by the vm, i have more than enough usb
ports on my backpanel.

Tried the gpu method by adding the id of the device in modprobe.d after
gpu's ids but it didn't work.

I paid it 50euros :(
Thanks for the explanations alex


2016-01-15 18:59 GMT+01:00 Alex Williamson <alex.williamson at redhat.com>:

> A couple comments, first, boot time pre-binding to vfio-pci is really
> only necessary for devices where the native host drivers behave poorly
> if you take the device away from them later.  This is why we do it for
> GPUs and their companion sound device, host GPU drivers don't like to
> give up the device, it plays poorly with any sort of graphics on the
> host, and sequestering the audio device prevents host tools from
> getting confused (and there are some bugs in the audio driver limiting
> number of attach/detach cycles iirc).
>
> For anything else, you can dynamically unbind the device from the host
> driver, bind it to vfio while the VM is running, and give it back to
> the host on shutdown.  libvirt will do this automatically for you if
> 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..)
>
> Finally, yes I've seen OVMF hang with some crappy USB controllers.  I'm
> not sure if it's dependent on the devices attached or the controller
> itself, but cheaper isn't always better when it comes to selecting
> devices to use with device assignment.  Thanks,
>
> Alex
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/vfio-users/attachments/20160116/41116446/attachment.htm>


More information about the vfio-users mailing list