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 1375417 - Libvirt should give the range for the configurable ports in nec-usb-xhci
Summary: Libvirt should give the range for the configurable ports in nec-usb-xhci
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.3
Hardware: x86_64
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Ján Tomko
QA Contact: jiyan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-13 04:02 UTC by Pei Zhang
Modified: 2017-08-02 01:27 UTC (History)
4 users (show)

Fixed In Version: libvirt-3.1.0-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 17:14:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2017:1846 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2017-08-01 18:02:50 UTC

Description Pei Zhang 2016-09-13 04:02:05 UTC
Description of problem:
USB controller nec-xhci has a configurable option ports, libvirt 
should limit the range of it.

Version-Release number of selected component (if applicable):
libvirt-2.0.0-8.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. define and configure a guest like following, 
configuring the ports valued 16 and plugging a redirect USB to the port.

# virsh dumpxml vm3 | grep usb -A 4

    <controller type='usb' index='0' model='nec-xhci' ports='16'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <channel type='spicevmc'>
--
    <redirdev bus='usb' type='spicevmc'>
      <address type='usb' bus='0' port='16'/>
    </redirdev>
 
2. start guest, guest fails to start.

# virsh start vm3 
error: Failed to start domain vm3
error: internal error: qemu unexpectedly closed the monitor: us=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -drive file=/tmp/zp/beaker/vm2.qcow2,format=qcow2,if=none,id=drive-virtio-disk0,serial=eca38821-c430-48a1-a932-a4814198f24d,cache=none,werror=stop,rerror=stop,aio=threads -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x6,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -chardev spicevmc,id=charchannel0,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=3,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 -spice port=5901,addr=0.0.0.0,disable-ticketing,seamless-migration=on -device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,vram64_size_mb=0,vgamem_mb=16,bus=pci.0,addr=0x2 -chardev spicevmc,id=charredir0,name=usbredir -device usb-redir,chardev=charredir0,id=redir0,bus=usb.0,port=16 -msg timestamp=on
2016-09-13T03:56:34.673060Z qemu-kvm: -device usb-redir,chardev=charredir0,id=redir0,bus=usb.0,port=16: usb port 16 (bus usb.0) not found (in use?)


Actual results:
As above, guest with nec-usb-xhci having ports valued 16 will fail to start.

Expected results:
Libvirt should give an error to limit the value of ports.

Additional info:

Comment 1 Ján Tomko 2017-01-31 14:09:06 UTC
Upstream patch:
https://www.redhat.com/archives/libvir-list/2017-January/msg01174.html

Comment 2 Ján Tomko 2017-02-13 15:39:43 UTC
Pushed as:
commit 723fef99c0e29d1a327aaea4cef477609f6ccbc2
Author:     Ján Tomko <jtomko>
CommitDate: 2017-02-13 16:34:09 +0100

    qemu: enforce maximum ports value for nec-xhci
    
    This controller only allows up to 15 ports.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1375417

git describe: v3.0.0-183-g723fef9

Comment 4 jiyan 2017-05-08 09:43:37 UTC
Version-Release number of selected component (if applicable):
libvirt-3.2.0-4.el7.x86_64
qemu-kvm-rhev-2.9.0-3.el7.x86_64
kernel-3.10.0-663.el7.x86_64

step to verify:
1.edit the vm's dumpxml file as follows:
    # virsh edit vm
    <controller type='usb' index='0' model='nec-xhci' ports='16'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <channel type='spicevmc'>
    ...
    <redirdev bus='usb' type='spicevmc'>
      <address type='usb' bus='0' port='16'/>
    </redirdev>

2.try to save the dumpxml file in the step 1
   # virsh edit vm
   Failed. Try again? [y,n,i,f,?]: 
   error: unsupported configuration: 'nec-xhci' controller only supports up to '15' ports


3.And verify other value of ports in controller
while "<controller type='usb' index='0' model='nec-xhci' ports='0'>"
# virsh edit cow
error: XML error: Missing USB bus 0

while "<controller type='usb' index='0' model='nec-xhci' ports='1'>"
# virsh edit cow
error: XML error: requested USB port 2 not present on USB bus 0

while "<controller type='usb' index='0' model='nec-xhci' ports='15'>"
# virsh edit cow
Domain cow XML configuration edited.
# virsh start cow
Domain cow started

Comment 5 errata-xmlrpc 2017-08-01 17:14:13 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://access.redhat.com/errata/RHEA-2017:1846

Comment 6 errata-xmlrpc 2017-08-01 23:55:08 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://access.redhat.com/errata/RHEA-2017:1846

Comment 7 errata-xmlrpc 2017-08-02 01:27:35 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://access.redhat.com/errata/RHEA-2017:1846


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