Bug 1035190

Summary: libvirt wrong parse of usbredir alias name
Product: Red Hat Enterprise Linux 6 Reporter: tingting zheng <tzheng>
Component: libvirtAssignee: Ján Tomko <jtomko>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.5CC: codong, dyuan, jtomko, juzhou, lcui, lsu, mzhan, rbalakri, tzheng, zpeng
Target Milestone: rcKeywords: Upstream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-0.10.2-33.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-14 04:18:47 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:

Description tingting zheng 2013-11-27 09:21:13 UTC
Description
libvirt wrong parse of usbredir alias name

Version:
libvirt-0.10.2-29.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Prepare a guest.
2.Use virsh edit guest to add usbredir devices,added part as below show:
   <redirdev bus='usb' type='tcp'>
      <source mode='connect' host='localhost' service='4000'/>
      <protocol type='raw'/>
      <alias name='redir0'/>
    </redirdev>

3.Save the update,error shows:
error: An error occurred, but the cause is unknown
Failed. Try again? [y,n,f,?]:

4.If I remove the alias part from xml,no error shows.

Actual results:
As step 3 describes.

Expected results:
libvirt can parse the alias name of usbredir device.

Additional info:
1.The issue block migration of guests with usbredir devices.

# virsh migrate --live mig qemu+ssh://$ip/system  
root@$ip's password:
error: An error occurred, but the cause is unknown

2.The issue can not be reproduced on rhel7.

Comment 2 Ján Tomko 2013-12-04 11:12:02 UTC
This has been fixed upstream as a part of
commit cc244e24416b7785258c69995483015bbf8927dd
CommitDate: 2012-11-21 17:54:35 +0100

    conf: add support for booting from redirected USB devices
    
    Commit a4c19459aa8634c43b51e8138fb1d7eec4c17824 only added the
    QEMU capability flag, command line option and added the boot element
    for redirdev's in the XML schema.
    
    This patch adds support for parsing and writing the XML with redirdevs
    with the boot flag. It also ignores unknown XML elements in redirdev
    instead of failing with:
    "error: An error occurred, but the cause is unknown"
    
    Bug: https://bugzilla.redhat.com/show_bug.cgi?id=805414

git describe: v1.0.0-91-gcc244e2 contains: v1.0.1-rc1~226

Comment 6 zhoujunqin 2014-04-23 08:22:28 UTC
I can reproduce this with package:
libvirt-0.10.2-32.el6.x86_64

verify with :
libvirt-0.10.2-33.el6.x86_64

verify steps:
1.Prepare a guest.
2.Plug in a usb device on host with usbredir packages installed.
# lsusb
Bus 002 Device 007: ID 058f:6387 Alcor Micro Corp. Flash Drive
# usbredirserver -p 4000 058f:6387
3.Use virsh edit guest to add usbredir devices,added part as below show:
   <redirdev bus='usb' type='tcp'>
      <source mode='connect' host='localhost' service='4000'/>
      <protocol type='raw'/>
      <alias name='redir0'/>
    </redirdev>

3.Save the update, no error shows:
# virsh edit rr66
Domain rr66 XML configuration edited.
4.boot the guest and check:
# virsh dumpxml rr66 |grep -A6 redirdev
    <redirdev bus='usb' type='tcp'>
      <source mode='connect' host='localhost' service='4000'/>
      <protocol type='raw'/>
      <alias name='redir0'/>
    </redirdev>

libvirt can parse the alias name of usbredir device correctly,so set as verified.

Comment 8 errata-xmlrpc 2014-10-14 04:18:47 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.

http://rhn.redhat.com/errata/RHBA-2014-1374.html