[Pkg-libvirt-maintainers] Bug#764811: libvirt-bin: USB Host Device not available

Paul Millar paul.millar at desy.de
Sat Oct 11 12:13:52 UTC 2014


Package: libvirt-bin
Version: 1.2.8-3
Severity: normal

Dear Maintainer,

I believe there is a regression in support for attaching USB host devices to a
virtual machine.  Some update seems to have broken this support --- possible
the switch to systemd, but I cannot say for sure.  As I have found a work-around,
I've labelled this problem as "normal" severity.

Here is a description with, I hope, sufficient information to understand and
reproduce it.

I have a USB external disk ("0d49:7410 Maxtor Mobile Hard Disk Drive (1TB)") that
behaves as a normal USB 2 mass-storage device.  (I can include the devices USB
profile, if that would help.)  Using Virtual Machine Manager and selecting
"Add Hardware" and "USB Host Device", I attached this device to the domain.

When starting the domain, I see the device disappear from the list of USB devices
my desktop shows (lsusb on the host OS still lists the device); however, the
device is not listed by lsusb running within the domain:


    [root at xanadu ~]# lsusb|grep Maxtor
    [root at xanadu ~]# 


Each time I run the lsusb command in the domain, the following kernel messages
are logged:


    usb 1-2.1: new low speed USB device number 12 using uhci_hcd
    usb 1-2.1: ep0 maxpacket = 64
    usb 1-2.1: new low speed USB device number 13 using uhci_hcd
    usb 1-2.1: ep0 maxpacket = 64
    usb 1-2.1: new low speed USB device number 14 using uhci_hcd
    usb 1-2.1: ep0 maxpacket = 64
    usb 1-2.1: new low speed USB device number 15 using uhci_hcd
    usb 1-2.1: ep0 maxpacket = 64
    hub 1-2:1.0: unable to enumerate USB device on port 1


What I find interesting is that when I alter the 'Controller USB' settings by
changing the 'Model' from "Default" to either "USB 2" or "USB 3" then the
external device is visible from within the domain.  With Model "USB 2" or
"USB 3", the device is visible to the domain:


    [root at xanadu ~]# lsusb|grep Maxtor
    Bus 001 Device 003: ID 0d49:7410 Maxtor Mobile Hard Disk Drive (1TB)
    [root at xanadu ~]# 


Also, with a Model of either "USB 2" or "USB 3", running the lsusb
command generates no kernel log messages in the domain's kernel log.

For reference, I've included information from the
/etc/libvirt/qemu/<machine>.xml file: a diff between the (broken)
"Default" Model and the (working) "USB 2" Model, a diff between
the "Default" Model and the (working) "USB 3" Model, and
the complete configuration with "USB 3" Model.

Cheers,

Paul.


---[ "Default" to "USB 2" diff ]---


--- xanadu.xml-default	2014-10-11 11:36:03.000000000 +0200
+++ xanadu.xml-usb2	2014-10-11 11:37:51.000000000 +0200
@@ -45,8 +45,20 @@
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
     </controller>
     <controller type='pci' index='0' model='pci-root'/>
-    <controller type='usb' index='0'>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+    <controller type='usb' index='0' model='ich9-ehci1'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x7'/>
+    </controller>
+    <controller type='usb' index='0' model='ich9-uhci1'>
+      <master startport='0'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0' multifunction='on'/>
+    </controller>
+    <controller type='usb' index='0' model='ich9-uhci2'>
+      <master startport='2'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x1'/>
+    </controller>
+    <controller type='usb' index='0' model='ich9-uhci3'>
+      <master startport='4'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x2'/>
     </controller>
     <interface type='network'>
       <mac address='52:54:00:4e:4c:a2'/>


---[ "Default" to "USB 3" diff ]---


--- xanadu.xml-default	2014-10-11 11:36:03.000000000 +0200
+++ xanadu.xml-usb3	2014-10-11 11:39:13.000000000 +0200
@@ -45,8 +45,8 @@
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
     </controller>
     <controller type='pci' index='0' model='pci-root'/>
-    <controller type='usb' index='0'>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+    <controller type='usb' index='0' model='nec-xhci'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
     </controller>
     <interface type='network'>
       <mac address='52:54:00:4e:4c:a2'/>


---[ Working "USB 3" configuration ]---


<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
  virsh edit xanadu
or other application using the libvirt API.
-->

<domain type='kvm'>
  <name>xanadu</name>
  <uuid>91cef140-bea4-41ea-4c9a-856c52e7779f</uuid>
  <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <os>
    <type arch='x86_64' machine='pc-0.14'>hvm</type>
    <bootmenu enable='no'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/images/xanadu.img'/>
      <target dev='vda' bus='virtio'/>
      <serial>1</serial>
      <boot order='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
    <disk type='block' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
      <boot order='2'/>
      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
    </disk>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='usb' index='0' model='nec-xhci'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </controller>
    <interface type='network'>
      <mac address='52:54:00:4e:4c:a2'/>
      <source network='default'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <input type='tablet' bus='usb'/>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes'/>
    <sound model='ac97'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </sound>
    <video>
      <model type='cirrus' vram='9216' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <hostdev mode='subsystem' type='usb' managed='yes'>
      <source>
        <vendor id='0x0d49'/>
        <product id='0x7410'/>
      </source>
    </hostdev>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </memballoon>
  </devices>
</domain>


-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.10-3-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libvirt-bin depends on:
ii  libvirt-clients        1.2.8-3
ii  libvirt-daemon-system  1.2.8-3

libvirt-bin recommends no packages.

libvirt-bin suggests no packages.

-- no debconf information



More information about the Pkg-libvirt-maintainers mailing list