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:
Better to report error when setting acpi index='0' in device rather than ignore it.
Version-Release number of selected component (if applicable):
libvirt-7.10.0-1.el9.x86_64
How reproducible:
100%
Steps to Reproduce:
1.Edit acpi index='0' for interface device and save xml:
#virsh edit vm1
...
<interface type='network'>
<mac address='52:54:00:11:3e:f2'/>
<source network='default'/>
<model type='virtio'/>
***<acpi index='0'/>***
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
...
2.Check guest xml and no acpi index setting:
#virsh dumpxml vm1 | grep -A8 interface
<interface type='network'>
<mac address='52:54:00:11:3e:f2'/>
<source network='default'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
3.
Actual results:
Can set acpi index='0' in device successfully but will ignore it actually.
Expected results:
It's better to report error when setting acpi index='0' in device, such as:
Invalid value for attribute 'index' in element 'acpi': '0'
Additional info:
Fixed upstream:
commit 6622e3cc33712450cc8bfdfb9a5a0b66e186e18d
Author: Peter Krempa <pkrempa>
Date: Tue Jan 18 15:43:42 2022 +0100
virDomainDeviceInfoParseXML: Reject '0' value for ACPI index
Value of '0' is treated equivalently to when it's not provided by the
user. Reject an explicit '0' provided by the user as it would get
ignored.
In this rare case we can make the XML parser more strict, as libvirt
would never format the '<acpi/>' element if the index is '0' thus there
are no libvirt-generated XMLs we'd not load back, as of such this is
identical to rejecting it in the validation phase.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2037146
Signed-off-by: Peter Krempa <pkrempa>
Reviewed-by: Michal Privoznik <mprivozn>
v8.0.0-104-g6622e3cc33
Comment 3yalzhang@redhat.com
2022-03-08 03:58:29 UTC
Test on libvirt-8.1.0-1.el9.x86_64, the result is as expected.
# virsh edit rhel
error: XML error: Invalid value for attribute 'index' in element 'acpi': Zero is not permitted
Failed. Try again? [y,n,i,f,?]:
Comment 6yalzhang@redhat.com
2022-04-14 09:07:26 UTC
Test on libvirt-8.2.0-1.el9.x86_64:
# virsh edit rhel
<interface type='network'>
<mac address='52:54:00:f5:aa:d5'/>
<source network='default'/>
<model type='e1000e'/>
<acpi index='0'/>
<address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
</interface>
error: XML error: Invalid value for attribute 'index' in element 'acpi': Zero is not permitted
Failed. Try again? [y,n,i,f,?]:
The result is as expected.
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 (Low: libvirt security, bug fix, and enhancement update), 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/RHSA-2022:8003
Description of problem: Better to report error when setting acpi index='0' in device rather than ignore it. Version-Release number of selected component (if applicable): libvirt-7.10.0-1.el9.x86_64 How reproducible: 100% Steps to Reproduce: 1.Edit acpi index='0' for interface device and save xml: #virsh edit vm1 ... <interface type='network'> <mac address='52:54:00:11:3e:f2'/> <source network='default'/> <model type='virtio'/> ***<acpi index='0'/>*** <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> ... 2.Check guest xml and no acpi index setting: #virsh dumpxml vm1 | grep -A8 interface <interface type='network'> <mac address='52:54:00:11:3e:f2'/> <source network='default'/> <model type='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> 3. Actual results: Can set acpi index='0' in device successfully but will ignore it actually. Expected results: It's better to report error when setting acpi index='0' in device, such as: Invalid value for attribute 'index' in element 'acpi': '0' Additional info: