Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Description of problem:
When setting pcie-switch-upstream-port index>=257, libvirt report
long unclear error message like this
# virsh create vm1-q35.xml
error: Failed to create domain from vm1-q35.xml
error: internal error: early end of file from monitor, possible problem: 247,bus=pci.9,addr=0x1c -device pci-bridge,chassis_nr=248,id=pci.248,bus=pci.9,addr=0x1d -device pci-bridge,chassis_nr=249,id=pci.249,bus=pci.9,addr=0x1e -device pci-bridge,chassis_nr=250,id=pci.250,bus=pci.9,addr=0x1f -device pci-bridge,chassis_nr=251,id=pci.251,bus=pci.10,addr=0x1 -device pci-bridge,chassis_nr=252,id=pci.252,bus=pci.10,addr=0x2 -device pci-bridge,chassis_nr=253,id=pci.253,bus=pci.10,addr=0x3 -device pci-bridge,chassis_nr=254,id=pci.254,bus=pci.10,addr=0x4 -device pci-bridge,chassis_nr=255,id=pci.255,bus=pci.10,addr=0x5 -device pci-bridge,chassis_nr=256,id=pci.256,bus=pci.10,addr=0x6 -device ich9-usb-ehci1,id=usb,bus=pcie.0,addr=0x1d.0x7 -device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pcie.0,multifunction=on,addr=0x1d -device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pcie.0,addr=0x1d.0x1 -device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pcie.0,addr=0x1d.0x2 -device vir!
tio-scsi-pci,id=scsi0,bus=pci.10,addr=0xa -device virtio
Version-Release number of selected component (if applicable):
100%
How reproducible:
libvirt-1.3.3-2.el7.x86_64
Steps to Reproduce:
1. prepare a xml and set pcie-switch-upstream-port controller's index=257
<controller type='pci' index='3' model='pcie-root-port'/>
<controller type='pci' index='257' model='pcie-switch-upstream-port'/>
2. create vm
# virsh create vm1-q35.xml
error: Failed to create domain from vm1-q35.xml
error: internal error: early end of file from monitor, possible problem: 247,bus=pci.9,addr=0x1c -device pci-bridge,chassis_nr=248,id=pci.248,bus=pci.9,addr=0x1d -device pci-bridge,chassis_nr=249,id=pci.249,bus=pci.9,addr=0x1e -device pci-bridge,chassis_nr=250,id=pci.250,bus=pci.9,addr=0x1f -device pci-bridge,chassis_nr=251,id=pci.251,bus=pci.10,addr=0x1 -device pci-bridge,chassis_nr=252,id=pci.252,bus=pci.10,addr=0x2 -device pci-bridge,chassis_nr=253,id=pci.253,bus=pci.10,addr=0x3 -device pci-bridge,chassis_nr=254,id=pci.254,bus=pci.10,addr=0x4 -device pci-bridge,chassis_nr=255,id=pci.255,bus=pci.10,addr=0x5 -device pci-bridge,chassis_nr=256,id=pci.256,bus=pci.10,addr=0x6 -device ich9-usb-ehci1,id=usb,bus=pcie.0,addr=0x1d.0x7 -device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pcie.0,multifunction=on,addr=0x1d -device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pcie.0,addr=0x1d.0x1 -device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pcie.0,addr=0x1d.0x2 -device vir!
tio-scsi-pci,id=scsi0,bus=pci.10,addr=0xa -device virtio
Actual results
Error messages are not friendly
Expected results
Actually creating vm failed due to chassis_nr out of range. So libvirt should provide proper error like this
# virsh create vm1-q35.xml
error: Failed to create domain from vm1-q35.xml
error: Parameter 'chassis_nr' out of range - must be 0-255
Additional info:
We do check the boundaries of chassis_nr, but that happens when parsing user input. We haven't been bounds-checking chassis_nr when the number is auto-generated.
A side note: on one hand, we apparently want to support > 256 downstream ports, but on the other hand each downstream port requires a chassis_nr, and we want chassis_nr (which is limited to 1-256) to be unique (see Bug 1349227). So which do we try to satisfy?
Fixed upstream:
commit 272f18563179d7372ce0a11b4425a0497cf70e93
Author: Laine Stump <laine>
Date: Sun Mar 26 20:47:17 2017 -0400
conf: validate that PCI controller index is < 256
Verified on libvirt-3.2.0-3.el7.x86_64.
1. Cold plug pcie-switch-upstream-port controllers to VM, index up to 256.
# cat /tmp/upstream.xml
<controller type='pci' index='INDEX' model='pcie-switch-upstream-port'/>
# for i in $(seq 6 2 256);do
sed "s/INDEX/$i/g" /tmp/upstream.xml > /tmp/xx.xml
sudo virsh attach-device q35-upstream /tmp/xx.xml --config
done
You will get a error when the index reaches 256:
error: unsupported configuration: PCI controller index 256 too high, maximum is 255
Failed. Try again? [y,n,i,f,?]:
Or you can use 'virsh edit' to add the index to 256:
# virsh edit q35-upstream
error: unsupported configuration: PCI controller index 256 too high, maximum is 255
Failed. Try again? [y,n,i,f,?]:
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
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