You are not logged in.

#1 2017-04-12 12:48:15

da_w01f
Member
Registered: 2017-04-12
Posts: 4

[SOLVED] KVM/libvirt cannot passtrough USB device (VFIO error)

Hello there,
Before I open a bug report I just wanna ask here: Does anybody around here experiences the same with KVM/QEMU?

On my current configuration (all updates installed) since like one and a half week I cannot pass USB devices (like USB-headset, cardreader) through KVM VMs.
It worked for months before.

The error message is quite strange because it tells about VFIO *PCI interface* problems while there is an USB *device* passed through.

virsh # start someVm
   error: Failed to start domain someVm
   error: Nicht unterstützte Konfiguration: host doesn't support VFIO PCI interface

(sorry for the German part in the message, export LC_ALL=C doesn't help here - it says  "non supported configuration")

When I start the VM (any VM) using virt-manager I see a python traceback output resulting in the error shown above:

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 88, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 124, in tmpcb
    callback(*args, **kwargs)
  File "/usr/share/virt-manager/virtManager/libvirtobject.py", line 83, in newfn
    ret = fn(self, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/domain.py", line 1479, in startup
    self._backend.create()
  File "/usr/lib/python2.7/site-packages/libvirt.py", line 1039, in create
    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirtError: Nicht unterstützte Konfiguration: host doesn't support VFIO PCI interface

journalcontrol doesn't show any new info here.
Maybe the error is just a result of incompatibilities in libvirt.py and thus its contents missleading?

virsh configuration for the USB device is this (simply configured by virt-manager clicking)

 # ... v---- is always there along with 3 other USB controllers
    <controller type='usb' index='0' model='ich9-uhci3'>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x2'/>
    </controller>

 # ... v------ is there when I add an USB device
    <hostdev mode='subsystem' type='usb' managed='yes'>
      <source>
        <vendor id='0x058f'/>
        <product id='0x9540'/>
      </source>
      <address type='usb' bus='0' port='4'/>
    </hostdev>
 # ...

So - is it just me or do you experience similar issues?



Thanks,
W01f

Versions Infos
Kernel: 4.9.21-1-lts 

libvirt stuff - versions:

libvirt 3.2.0-2
libvirt-glib 1.0.0-1
libvirt-python2 3.2.0-2
libvirt-python3 3.2.0-1
virt-manager 1.4.1-2

qemu stuff - versions

qemu 2.8.0-2
qemu-arch-extra 2.8.0-2

Python stuff - versions:

$ python --version
   Python 3.6.0

$ python2 --version
   Python 2.7.13

Last edited by da_w01f (2017-04-19 09:06:27)

Offline

#2 2017-04-12 12:59:32

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: [SOLVED] KVM/libvirt cannot passtrough USB device (VFIO error)

The so called "USB passthrough" isn't even done through VFIO but libusb, unless you passthrough the whole usb host controller (unlikely). Perhaps you mis-added an vfio pci device?

P.S. Why would you want multiple emulated USB host controllers? Also why not paste their entries as well?

Last edited by tom.ty89 (2017-04-12 13:02:26)

Offline

#3 2017-04-12 13:36:08

da_w01f
Member
Registered: 2017-04-12
Posts: 4

Re: [SOLVED] KVM/libvirt cannot passtrough USB device (VFIO error)

Hi,

tom.ty89 wrote:

"USB passthrough" isn't even done through VFIO but libusb

Exactly.

tom.ty89 wrote:

Perhaps you mis-added an vfio pci device?

No. /sys/kernel/iommu_groups/ is completely empty, if that's the right indicator.

tom.ty89 wrote:

Why would you want multiple emulated USB host controllers?

Ah yes, sorry - my bad. This is missleading as the problem also appears on VMs with the one standard USB Controller virt-manager adds when creating a new machine.
I should have used the configuration of a simpler VM as example.

Anyway - thats not part of the problem here I'm sure.

W01f

Offline

#4 2017-04-17 10:16:45

nazarianin
Member
Registered: 2017-04-17
Posts: 1

Re: [SOLVED] KVM/libvirt cannot passtrough USB device (VFIO error)

Offline

#5 2017-04-19 09:05:06

da_w01f
Member
Registered: 2017-04-12
Posts: 4

Re: [SOLVED] KVM/libvirt cannot passtrough USB device (VFIO error)

Thanks nazarianin - this seems to be the exact solution to my problem. Because of time issues I will not patch and recompile libvirt by myself for now - a quick temporary solution was to downgrade to libvirt-3.1.0-1 from march (with a small bunch of dependencies). I'm sure it will be fine with the next libvirt update as the patch is already upstram. I'll mark this as solved.

W01f

Offline

Board footer

Powered by FluxBB