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 1035128 - Stable guest ABI doesn't check redirected usb device
Summary: Stable guest ABI doesn't check redirected usb device
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Ján Tomko
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 1035529
TreeView+ depends on / blocked
 
Reported: 2013-11-27 06:46 UTC by tingting zheng
Modified: 2016-04-26 14:46 UTC (History)
7 users (show)

Fixed In Version: libvirt-1.2.7-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1035529 (view as bug list)
Environment:
Last Closed: 2015-03-05 07:28:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0323 0 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2015-03-05 12:10:54 UTC

Description tingting zheng 2013-11-27 06:46:32 UTC
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 12:04:19 UTC
Upstream patch proposed:
https://www.redhat.com/archives/libvir-list/2014-April/msg00076.html

Comment 3 Ján Tomko 2014-04-03 13:25:02 UTC
Now fixed upstream:
commit c9123fbe85430dab5e737b20f5657aab650a5d45
Author:     Ján Tomko <jtomko>
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 08:39:00 UTC
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.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.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.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.106.26's password:

Comment 8 errata-xmlrpc 2015-03-05 07:28:31 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/RHSA-2015-0323.html


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