<div dir="ltr">I'm doing exactly this with no significant problem.  The way I handle it is that I've got a script that binds the specific card to vfio-pci at runtime, and I call that as a part of my startup script for the VM.<div><br></div><div>/usr/local/bin/vfio-bind</div><div>#!/bin/bash</div><div><br></div><div>modprobe vfio-pci</div><div><br></div><div>for dev in "$@"; do</div><div>        vendor=$(cat /sys/bus/pci/devices/$dev/vendor)</div><div>        device=$(cat /sys/bus/pci/devices/$dev/device)</div><div>        if [ -e /sys/bus/pci/devices/$dev/driver ]; then</div><div>                echo $dev > /sys/bus/pci/devices/$dev/driver/unbind</div><div>        fi</div><div>        echo $vendor $device > /sys/bus/pci/drivers/vfio-pci/new_id</div><div>done</div><div><br></div><div>Then I just add "-device vfio-pci,host=<address>" to the args to qemu.  Works like a charm.  The script is called with the format "0000:06:00.0", the args to qemu are "06:00.0".  Your address may vary, of course.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 25, 2016 at 6:11 AM, Andrei Grigore <span dir="ltr"><<a href="mailto:andrei.grg@gmail.com" target="_blank">andrei.grg@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Hi,</p>
<p dir="ltr">Does anyone know of an easy way to pass through a USB PCI controller in QEMU w/o libvirt? Since libvirt automatically binds the controller to VFIO, without it I get VFIO not found error messages.</p>
<p dir="ltr">I am getting slightly better performance with a QEMU script rather than using virt-manager. I cannot bind them on boot since I have the same id for all USBs.</p>
<p dir="ltr">Thanks!</p>
<br>______________________________<wbr>_________________<br>
vfio-users mailing list<br>
<a href="mailto:vfio-users@redhat.com">vfio-users@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/vfio-users" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/vfio-users</a><br>
<br></blockquote></div><br></div>