RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1210650 - Redirecting usb device cannot be found in guest after reboot guest when specify redirfilter version='2.01'
Summary: Redirecting usb device cannot be found in guest after reboot guest when speci...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: Ján Tomko
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-04-10 09:38 UTC by Pei Zhang
Modified: 2015-11-19 06:28 UTC (History)
8 users (show)

Fixed In Version: libvirt-1.2.15-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 06:28:06 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2202 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2015-11-19 08:17:58 UTC

Description Pei Zhang 2015-04-10 09:38:44 UTC
Description of problem:
Redirecting usb device can be found in guest during first start . But the optional element "version" will be changed after saving into guest xml , and also be changed after reboot the guest  ; so redirecting usb device cannot be found in guest if I specify the redirfilter version .


version
kernel-3.10.0-234.el7.x86_64
qemu-kvm-rhev-2.2.0-8.el7.x86_64
libvirt-1.2.14-1.el7.x86_64

How reproducible:
100%

step to reproduce :

1.prepare a usb device .

# lsusb -v | grep SanDisk -A 9
Bus 002 Device 003: ID 0781:5567 SanDisk Corp. Cruzer Blade
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x0781 SanDisk Corp.
  idProduct          0x5567 Cruzer Blade
  bcdDevice            2.01                     <=== the version value
  iManufacturer           1 SanDisk
  iProduct                2 Cruzer Blade
  iSerial                 3 4C532000010510102461
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1


2. prepare a healthy guest and add follow xml into guest , then start the guest

#virsh edit r7.1
......
  <redirdev bus='usb' type='spicevmc'>
      <alias name='redir0'/>
    </redirdev>
    <redirdev bus='usb' type='spicevmc'>
      <alias name='redir1'/>
    </redirdev>
    <redirfilter>
      <usbdev class='0x08' vendor='0x0781' product='0x5567' version='2.01' allow='yes'/>
      <usbdev allow='no'/>
    </redirfilter>

save the xml and start the guest , check qemu CLI and guest xml:
#ps -ef|grep qemu
......
-chardev spicevmc,id=charredir0,name=usbredir -device usb-redir,chardev=charredir0,id=redir0,filter=0x08:0x0781:0x5567:0x0201:1|-1:-1:-1:-1:0 -chardev spicevmc,id=charredir1,name=usbredir -device usb-redir,chardev=charredir1,id=redir1,filter=0x08:0x0781:0x5567:0x0201:1|-1:-1:-1:-1:0
......


#virsh dumpxml r7.1 | grep redirdev -A 9
    <redirdev bus='usb' type='spicevmc'>
      <alias name='redir0'/>
    </redirdev>
    <redirdev bus='usb' type='spicevmc'>
      <alias name='redir1'/>
    </redirdev>
    <redirfilter>
      <usbdev class='0x08' vendor='0x0781' product='0x5567' version='2.1' allow='yes'/>   <=== the value of version was changed to 2.1 after saved.
      <usbdev allow='no'/>
    </redirfilter>

3.using virt-viewer to check into guest , the usb device can be found in guest and can be added into guest through file->USB Device selection.
#virt-viewer r7.1
......

4. reboot guest . using virt-viewer to check again
# virsh destroy r7.1;virsh start r7.1
Domain r7.1 destroyed

Domain r7.1 started

# virsh dumpxml r7.1 | grep redirdev -A 9
    <redirdev bus='usb' type='spicevmc'>
      <alias name='redir0'/>
    </redirdev>
    <redirdev bus='usb' type='spicevmc'>
      <alias name='redir1'/>
    </redirdev>
    <redirfilter>
      <usbdev class='0x08' vendor='0x0781' product='0x5567' version='2.10' allow='yes'/> <=== the value of version was changed to 2.10 after reboot guest
      <usbdev allow='no'/>
    </redirfilter>

check qemu CLI :
#ps -ef|grep qemu
......
 -device usb-redir,chardev=charredir0,id=redir0,filter=0x08:0x0781:0x5567:0x0210:1|-1:-1:-1:-1:0 -chardev spicevmc,id=charredir1,name=usbredir -device usb-redir,chardev=charredir1,id=redir1,filter=0x08:0x0781:0x5567:0x0210:1|-1:-1:-1:-1:0 -

5.using virt-viewer to check into guest , the usb device CANNOT be redirected into guest.

Actual results:
As step 4 and step 5 , the value of version was changed , so the usb device cannot be redirected into guest .

Expected results:
The usb device should always be found in the guest .

Comment 1 Ján Tomko 2015-04-10 14:29:21 UTC
Upstream patches:
https://www.redhat.com/archives/libvir-list/2015-April/msg00409.html

Comment 2 Ján Tomko 2015-04-13 11:07:42 UTC
Fixed upstream by:
commit a75069be35c7e99109ad15c1eefef13a42b0622b
Author:     Ján Tomko <jtomko>
CommitDate: 2015-04-13 12:33:41 +0200

    Fix usb device version parsing issues
    
    Request that the number be parsed as decimal, to allow 08
    and 09.
    
    Format it with the leading zero, 1.01 and 1.10 are two
    different versions.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1210650

git describe: v1.2.14-112-ga75069b

Comment 4 Pei Zhang 2015-06-04 10:00:13 UTC
I can reproduce it . and verify as below ,

verify version :
libvirt-1.2.15-2.el7.x86_64
qemu-kvm-rhev-2.3.0-1.el7.x86_64

steps:
prepare host usb devices.

1.start a guest like following 

# virsh dumpxml usb | grep redirdev -A 10
    <redirdev bus='usb' type='spicevmc'>
      <alias name='redir0'/>
      <address type='usb' bus='1' port='1'/>
    </redirdev>
    <redirdev bus='usb' type='spicevmc'>
      <alias name='redir1'/>
    </redirdev>
    <redirdev bus='usb' type='spicevmc'>
      <alias name='redir2'/>
    </redirdev>
    <redirfilter>
      <usbdev class='0x03' vendor='0x17EF' product='0x6019' version='63.00' allow='yes'/>
      <usbdev class='0x08' vendor='0x0781' product='0x5567' version='2.01' allow='yes'/>
      <usbdev class='0x08' vendor='0x0951' product='0x1656' version='1.10' allow='yes'/>
      <usbdev allow='no'/>
    </redirfilter>
2.using virt-viewer to check into guest , all these three  usb device can be added into guest through file->USB Device selection and found in guest .
#virt-viewer usb 
......

3.destroy and start guest ,using virt-viewer check again . all usb devices also can be redirected into guest .

move to verified .

Comment 6 errata-xmlrpc 2015-11-19 06:28:06 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2202.html


Note You need to log in before you can comment on or make changes to this bug.