Bug 1001999

Summary: [RFE] USB Redirection device options in virt-install
Product: Red Hat Enterprise Linux 6 Reporter: Martin Kletzander <mkletzan>
Component: python-virtinstAssignee: Giuseppe Scrivano <gscrivan>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.5CC: adevolder, codong, dyuan, gscrivan, lcui, mjenner, mkletzan, mzhan, rbalakri, rmcswain, tzheng
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: python-virtinst-0.600.0-23.el6 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: 964215 Environment:
Last Closed: 2014-10-14 06:23:37 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:
Bug Depends On:    
Bug Blocks: 807277, 964215, 1031775    

Comment 10 tingting zheng 2014-06-03 07:09:02 UTC
Tested the bug with:
virt-manager-0.9.0-25.el6.x86_64
python-virtinst-0.600.0-24.el6.noarch

Steps:
1.Check virt-install manual,--dredirdev has been added there.

       --redirdev=BUS[,OPTS]
         Add a redirected device.

         type
             The redirection type, currently supported is tcp or spicevmc.

         server
             The TCP server connection details, of the form ’server:port’.

         Examples of invocation:

         --redirdev usb,type=tcp,server=localhost:4000
             Add a USB redirected device provided by the TCP server on ’localhost’ port 4000.

         --redirdev usb,type=spicevmc
             Add a USB device redirected via a dedicated Spice channel.

2.Use virt-install to set USB Redirection device options:
# virt-install -n usbtest -r 1024 --disk /var/lib/libvirt/images/rhel6.5-clone.img --import --graphics spice --video qxl --channel spicevmc --redirdev usb,type=spicevmc

Starting install...
Creating domain... 

3. Check the xml file of the guest,it adds usb2 controllers by default.
# virsh dumpxml usbtest
   <controller type='usb' index='0' model='ich9-ehci1'>
      <alias name='usb0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <alias name='usb0'/>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <alias name='usb0'/>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <alias name='usb0'/>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x2'/>
    </controller>
    <redirdev bus='usb' type='spicevmc'>
      <alias name='redir0'/>
    </redirdev>

4. Plug a usb disk on host,from virt-viewer console,the usb disk can be redirected successfully to guest.

5. Repeat the above steps to try usb redirection with tcp type.
# usbredirserver -p 5000 0951:1656
usbredirparser: Peer version: qemu usb-redir guest 0.12.1, using 64-bits ids

# virt-install -n usbtest -r 1024 --disk /var/lib/libvirt/images/rhel6.5-clone.img --import --graphics spice --video qxl --channel spicevmc --redirdev usb,type=tcp,server=localhost:5000

Starting install...
Creating domain...                                                                                     |    0 B     00:00     

#virsh dumpxml usbtest
   <controller type='usb' index='0' model='ich9-ehci1'>
      <alias name='usb0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <alias name='usb0'/>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <alias name='usb0'/>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <alias name='usb0'/>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x2'/>
    </controller>
    <redirdev bus='usb' type='tcp'>
      <source mode='connect' host='localhost' service='5000'/>
      <protocol type='raw'/>
      <alias name='redir0'/>
    </redirdev>

As there are bugs 807277 and 1085318 to track usb redirection issues,option --redirdev in virt-install has been added and worked successfully,so move the bug to VERIFIED.

Comment 11 errata-xmlrpc 2014-10-14 06:23:37 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-1444.html