K800 keyboard no longer works when attached to a VM

Bug #1846451 reported by Rokas Kupstys
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QEMU
Fix Released
Undecided
Unassigned

Bug Description

I use Logitech K800 keyboard which is connected to a PC through Logitech unifying receiver. In order to control my windows VM i attach unifying receiver USB device to a VM using "virsh attach-device VM-Name ./device.xml". Device ID as seen in lsusb is 046d:c52b.

As of v4.1.0 keyboard no longer works when attached to a windows VM. When attached receiver is still at least partially functional. Logitech pairing utility properly displays paired keyboard, pressing buttons on the keyboard shows changing indicator icon in pairing utility. Pairing and unpairing works. Pressing keys however fails to register any key presses.

Downgrading to v4.0.0 fixes the issue.

device.xml used to attach USB device:
```
<hostdev mode='subsystem' type='usb'>
        <source>
                <vendor id='0x046d'/>
                <product id='0xc52b'/>
        </source>
</hostdev>

```

Revision history for this message
Rokas Kupstys (rokups) wrote :
Revision history for this message
Gerd Hoffmann (kraxel-redhat) wrote :

There are only two pass-through changes:

commit bfe44898848614cfcb3a269bc965afbe1f0f331c
commit 65f14ab98da1da920f98ee8734dc1588b01d6b2b

Can you check whenever reverting the one or the other or both restores 4.0 behavior?

Can you add "lsusb -v" output for the device in question to the bug?

Revision history for this message
Rokas Kupstys (rokups) wrote :
Download full text (4.2 KiB)

Reverting 65f14ab98da1da920f98ee8734dc1588b01d6b2b fixes the issue.

lsusb -v:
Bus 002 Device 008: ID 046d:c52b Logitech, Inc. Unifying Receiver
Couldn't open device, some information will be missing
Device Descriptor:
  bLength 18
  bDescriptorType 1
  bcdUSB 2.00
  bDeviceClass 0
  bDeviceSubClass 0
  bDeviceProtocol 0
  bMaxPacketSize0 8
  idVendor 0x046d Logitech, Inc.
  idProduct 0xc52b Unifying Receiver
  bcdDevice 12.08
  iManufacturer 1
  iProduct 2
  iSerial 0
  bNumConfigurations 1
  Configuration Descriptor:
    bLength 9
    bDescriptorType 2
    wTotalLength 0x0054
    bNumInterfaces 3
    bConfigurationValue 1
    iConfiguration 4
    bmAttributes 0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower 98mA
    Interface Descriptor:
      bLength 9
      bDescriptorType 4
      bInterfaceNumber 0
      bAlternateSetting 0
      bNumEndpoints 1
      bInterfaceClass 3 Human Interface Device
      bInterfaceSubClass 1 Boot Interface Subclass
      bInterfaceProtocol 1 Keyboard
      iInterface 0
        HID Device Descriptor:
          bLength 9
          bDescriptorType 33
          bcdHID 1.11
          bCountryCode 0 Not supported
          bNumDescriptors 1
          bDescriptorType 34 Report
          wDescriptorLength 59
         Report Descriptors:
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength 7
        bDescriptorType 5
        bEndpointAddress 0x81 EP 1 IN
        bmAttributes 3
          Transfer Type Interrupt
          Synch Type None
          Usage Type Data
        wMaxPacketSize 0x0008 1x 8 bytes
        bInterval 8
    Interface Descriptor:
      bLength 9
      bDescriptorType 4
      bInterfaceNumber 1
      bAlternateSetting 0
      bNumEndpoints 1
      bInterfaceClass 3 Human Interface Device
      bInterfaceSubClass 1 Boot Interface Subclass
      bInterfaceProtocol 2 Mouse
      iInterface 0
        HID Device Descriptor:
          bLength 9
          bDescriptorType 33
          bcdHID 1.11
          bCountryCode 0 Not supported
          bNumDescriptors 1
          bDescriptorType 34 Report
          wDescriptorLength 148
         Report Descriptors:
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength 7
        bDescriptorType 5
        bEndpointAddress 0x82 EP 2 IN
        bmAttributes 3
          Transfer Type Interrupt
          Synch Type None
          Usage Type Data
        wMaxPacketSize 0x0008 1x 8 bytes
        bInterval 2
    Interface Descri...

Read more...

Revision history for this message
Gerd Hoffmann (kraxel-redhat) wrote :
Revision history for this message
Rokas Kupstys (rokups) wrote :

Could you please clarify how this config is supposed to be used? I would test your patch.

Revision history for this message
Gerd Hoffmann (kraxel-redhat) wrote :

qemu: -device usb-host,...,guest-resets-all=true

libvirt:

   <qemu:arg value='-set'/>
   <qemu:arg value='device.hostdev0.guest-resets-all=true'/>

... assuming this is is the only pass-through device.

If you pass through more devices you''l have hostdev0, hostdev1, ... and have to pick the correct one.

(see also http://blog.vmsplice.net/2011/04/how-to-pass-qemu-command-line-options.html)

Revision history for this message
Rokas Kupstys (rokups) wrote :

I am bit slow to test, but i just realized that i am still not sure how to test this. My devices are attached using "virsh attach" after system has started. So it seems to me there is no way to test it with libvirt. A global option to restore old behavior would be useful until libvirt starts supporting this option.

Revision history for this message
Thomas Huth (th-huth) wrote :

Patch has been included here:
https://git.qemu.org/?p=qemu.git;a=commitdiff;h=1dfe2b91dcb1633d0ba450
... and been released with QEMU v4.2

Changed in qemu:
status: New → Fix Released
Revision history for this message
Rokas Kupstys (rokups) wrote :

Any way to get old behavior back when using `virsh attach` command? Devices are not attached on boot. I am stuck with qemu 4.0 because of this.

Revision history for this message
Gerd Hoffmann (kraxel-redhat) wrote :

Try this:

   <qemu:arg value='-global'/>
   <qemu:arg value='usb-host.guest-resets-all=true'/>

Not fully sure this works for hotplugged devices though.

Revision history for this message
Rokas Kupstys (rokups) wrote :

It works with virsh device-attach. Thank you very much.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.