Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1035128 - Stable guest ABI doesn't check redirected usb device
Stable guest ABI doesn't check redirected usb device
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.0
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Ján Tomko
Virtualization Bugs
:
Depends On:
Blocks: 1035529
  Show dependency treegraph
 
Reported: 2013-11-27 01:46 EST by tingting zheng
Modified: 2016-04-26 10:46 EDT (History)
7 users (show)

See Also:
Fixed In Version: libvirt-1.2.7-1.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1035529 (view as bug list)
Environment:
Last Closed: 2015-03-05 02:28:31 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0323 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2015-03-05 07:10:54 EST

  None (edit)
Description tingting zheng 2013-11-27 01:46:32 EST
Description
Stable guest ABI doesn't check redirected usb device

Version:
libvirt-1.1.1-13.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Prepare a guest.
2.Plug in a usb device on host with usbredir packages installed.
# lsusb
Bus 006 Device 003: ID 15e1:2007 RSA RSA SecurID (R) Authenticator
 
# usbredirserver -p 4000 15e1:2007

3. Configure the guest with Redirected USB Device in virt-manager,
Add Hardware-> USB Redirection-> type: tcp, Address:&hostip,port as 4000.

4. Boot the guest.

5.Use virsh dumpxml to get the xml of the guest.
# virsh dumpxml mig > mig.xml
……
    <redirdev bus='usb' type='tcp'>
      <source mode='connect' host='$ip' service='4000'/>
      <protocol type='raw'/>
    </redirdev>
……

6.Change the type in xml from 'tcp' to 'spicevmc'.
change xml from:
    <redirdev bus='usb' type='tcp'>
      <source mode='connect' host='$ip' service='4000'/>
      <protocol type='raw'/>
    </redirdev>
to:
    <redirdev bus='usb' type='spicevmc'>
      <source mode='connect' host='$ip' service='4000'/>
      <protocol type='raw'/>
    </redirdev>

5.Do migrate,no error shows.
# virsh migrate --live mig qemu+ssh://$ip/system --xml mig.xml


Actual results:
As step 5 describes.

Expected results:
Error shows when type of redirected usb device in xml is different with guest.
eg:error: unsupported configuration: Target redirected usb device type 'spicevmc' does not match source 'tcp'
Comment 2 Ján Tomko 2014-04-02 08:04:19 EDT
Upstream patch proposed:
https://www.redhat.com/archives/libvir-list/2014-April/msg00076.html
Comment 3 Ján Tomko 2014-04-03 09:25:02 EDT
Now fixed upstream:
commit c9123fbe85430dab5e737b20f5657aab650a5d45
Author:     Ján Tomko <jtomko@redhat.com>
CommitDate: 2014-04-03 15:21:38 +0200

    Add redirdevs to ABI stability check
    
    Check the bus, type of the source device (tcp vs. spicevmc)
    and the device address visible in the guest.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1035128

git describe: v1.2.3-38-gc9123fb
Comment 6 lcheng 2014-11-27 03:39:00 EST
Verify the bug as follows. The result is expected.


Version:
libvirt-1.2.8-9.el7.x86_64
qemu-kvm-rhev-2.1.2-13.el7.x86_64
qemu-kvm-1.5.3-82.el7.x86_64


Preparation:

1. Plug in a usb device on host.
# lsusb
Bus 001 Device 007: ID 8644:8303
 
# usbredirserver -p 4000 8644:8303

2. Configure the guest with Redirected USB Device in virt-manager,
Add Hardware-> USB Redirection-> type: tcp, Address: 10.66.5.123, port: 4000.

3. Boot the guest.

4. Get the xml of the guest.
# virsh dumpxml r7 > mig.xml
...
    <redirdev bus='usb' type='tcp'>
      <source mode='connect' host='10.66.5.123' service='4000'/>
      <protocol type='raw'/>
      <alias name='redir4'/>
    </redirdev>
...


Steps:

Scenario 1: change type

1.1 Change the type in mig.xml from 'tcp' to 'spicevmc'.
change xml from:
    <redirdev bus='usb' type='tcp'>
      <source mode='connect' host='10.66.5.123' service='4000'/>
      <protocol type='raw'/>
      <alias name='redir4'/>
    </redirdev>
to:
    <redirdev bus='usb' type='spicevmc'>
      <source mode='connect' host='10.66.5.123' service='4000'/>
      <protocol type='raw'/>
      <alias name='redir4'/>
    </redirdev>

1.2 Do migrate.
# virsh migrate --live r7 qemu+ssh://10.66.106.26/system --xml mig.xml
root@10.66.106.26's password: 
error: unsupported configuration: Target redirected device source type spicevmc does not match source device source type tcp


Scenario 2: change bus

2.1 Change the bus in mig.xml from 'usb' to 'pci'.
change xml from:
    <redirdev bus='usb' type='tcp'>
      <source mode='connect' host='10.66.5.123' service='4000'/>
      <protocol type='raw'/>
      <alias name='redir4'/>
    </redirdev>
to:
    <redirdev bus='pci' type='spicevmc'>
      <source mode='connect' host='10.66.5.123' service='4000'/>
      <protocol type='raw'/>
      <alias name='redir4'/>
    </redirdev>


2.2 Do migrate.
# virsh migrate --live r7 qemu+ssh://10.66.106.26/system --xml mig.xml
root@10.66.106.26's password: 
error: unsupported configuration: unknown redirdev bus 'pci'


Scenario 3: change devices count 

3.1 Change the mig.xml as following.
change xml from:
    <redirdev bus='usb' type='tcp'>
      <source mode='connect' host='10.66.5.123' service='4000'/>
      <protocol type='raw'/>
      <alias name='redir4'/>
    </redirdev>
to:
    <redirdev bus='usb' type='tcp'>
      <source mode='connect' host='10.66.5.123' service='4000'/>
      <protocol type='raw'/>
      <alias name='redir4'/>
    </redirdev>
    <redirdev bus='usb' type='tcp'>
      <source mode='connect' host='10.66.5.123' service='4000'/>
      <protocol type='raw'/>
      <alias name='redir4'/>
    </redirdev>


3.2 Do migrate.
# virsh migrate --live r7 qemu+ssh://10.66.106.26/system --xml mig.xml
root@10.66.106.26's password: 
error: unsupported configuration: Target domain redirected devices count 2 does not match source 1


Scenario 4: no change

4.1 Don't modify mig.xml
    <redirdev bus='usb' type='tcp'>
      <source mode='connect' host='10.66.5.123' service='4000'/>
      <protocol type='raw'/>
      <alias name='redir4'/>
    </redirdev>

4.2 Do migrate, no error shows.
# virsh migrate --live r7 qemu+ssh://10.66.106.26/system --xml mig.xml
root@10.66.106.26's password:
Comment 8 errata-xmlrpc 2015-03-05 02:28:31 EST
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/RHSA-2015-0323.html

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