Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1625511

Summary: Starting VM with several USB device (which can boot successfully when disabling USB support) failed when enabling USB support because identifying USB device plugged to hub failed
Product: Red Hat Enterprise Virtualization Manager Reporter: jiyan <jiyan>
Component: ovirt-engineAssignee: Nobody <nobody>
Status: CLOSED CURRENTRELEASE QA Contact: meital avital <mavital>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.2.5CC: dyuan, hhan, jiyan, lsurette, rbarry, Rhev-m-bugs, srevivo, tburke, xuzhang, yalzhang
Target Milestone: ovirt-4.4.0   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-04-17 11:28:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Dumpxml of VM when diabling USB support
none
Dumpxml of VM when enabling USB support none

Description jiyan 2018-09-05 06:08:37 UTC
Description of problem:
Starting VM with several USB device failed after enabling USB suport because identifying USB device plugged to hub failed

Version-Release number of selected component (if applicable):
server: 
rhvm-4.2.5.1-0.1.el7ev.noarch

host: 
vdsm-4.20.39-1.el7ev.x86_64
kernel-3.10.0-942.el7.x86_64
libvirt-4.5.0-8.el7.x86_64
qemu-kvm-rhev-2.12.0-12.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. New VM with several USB host device, disable USB support. start Vm successfully.
==> In this scenario, In XML, using 'piix3-uhci' USB controller which only supports 2 ports, so hub will be added, and several USB devices will be plugged to hub.
the dumpxml of VM is as following:
# virsh dumpxml jiyan-1
...
    <controller type='usb' index='0' model='piix3-uhci'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
...
    <controller type='ccid' index='0'>
      <alias name='ccid0'/>
      <address type='usb' bus='0' port='1'/>
    </controller>
...
    <hub type='usb'>
      <alias name='hub0'/>
      <address type='usb' bus='0' port='2'/>
    </hub>
...
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <address bus='2' device='2'/>
      </source>
      <alias name='ua-3ad599b3-069d-4849-8391-43cf97b17240'/>
      <address type='usb' bus='0' port='2.1'/>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <address bus='3' device='2'/>
      </source>
      <alias name='ua-6f48fe4c-fbb5-48c5-9ca5-852006b83510'/>
      <address type='usb' bus='0' port='2.2'/>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <address bus='2' device='3'/>
      </source>
      <alias name='ua-801d94ed-661b-45f2-a324-9f968d1363c0'/>
      <address type='usb' bus='0' port='2.3'/>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <address bus='3' device='4'/>
      </source>
      <alias name='ua-811d84bf-1a97-4fd8-b10d-ce14a98e52a6'/>
      <address type='usb' bus='0' port='2.4'/>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <address bus='3' device='3'/>
      </source>
      <alias name='ua-a16494ac-2a31-4639-95db-11f6dc8186f7'/>
      <address type='usb' bus='0' port='2.5'/>
    </hostdev>

2. Shut down VM, then ensble 'USB support', VM will start failed with the following error
2018-09-05 01:46:37,028-04 ERROR [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (ForkJoinPool-1-worker-11) [] EVENT_ID: VM_DOWN_ERROR(119), VM jiyan-1 is down with error. Exit message: XML error: there is no hub at port 2 in USB address bus: 0 port: 2.1.
2018-09-05 01:46:37,045-04 ERROR [org.ovirt.engine.core.vdsbroker.monitoring.VmsMonitoring] (ForkJoinPool-1-worker-11) [] Rerun VM '488061ac-89e5-4139-b01c-bcc6bd9e4119'. Called from VDS 'host5'
2018-09-05 01:46:37,061-04 WARN  [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (EE-ManagedThreadFactory-engine-Thread-233944) [] EVENT_ID: USER_INITIATED_RUN_VM_FAILED(151), Failed to run VM jiyan-1 on Host host5.

Actual results:
As step-2 shows

Expected results:
The XML should be adjusted automatically and VM should start successfully.

Additional info:
In step-2, the XML is as following, Checking this XML in ovirt-engine.log:

  43483     <controller type="usb" model="ich9-uhci1" index="0"/>
  43527     <controller type="usb" model="ich9-ehci1" index="0"/>
  43568     <controller type="usb" model="ich9-uhci2" index="0"/>
  43569     <controller type="usb" model="ich9-uhci3" index="0"/>
  ...
  43484     <hostdev managed="no" mode="subsystem" type="usb">
  43485       <source>
  43486         <address bus="2" device="2"/>
  43487       </source>
  43488       <alias name="ua-3ad599b3-069d-4849-8391-43cf97b17240"/>
  43489       <address bus="0" port="2.1" type="usb"/>
  43490     </hostdev>

Comment 1 jiyan 2018-09-05 06:09:33 UTC
Created attachment 1480984 [details]
Dumpxml of VM when diabling USB support

Comment 2 jiyan 2018-09-05 06:10:01 UTC
Created attachment 1480985 [details]
Dumpxml of VM when enabling USB support

Comment 3 Ryan Barry 2019-04-17 11:28:24 UTC
Works on current releases. Please re-open if this is still reproducible