Bug 1210650
| Summary: | Redirecting usb device cannot be found in guest after reboot guest when specify redirfilter version='2.01' | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Pei Zhang <pzhang> |
| Component: | libvirt | Assignee: | Ján Tomko <jtomko> |
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 7.2 | CC: | dyuan, jtomko, juzhou, lcheng, mzhan, rbalakri, tzheng, xuzhang |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-1.2.15-1.el7 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-11-19 06:28:06 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
Upstream patches: https://www.redhat.com/archives/libvir-list/2015-April/msg00409.html 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
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 .
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 |
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 .