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 2037146 - Better to report error when setting acpi index='0' in device
Summary: Better to report error when setting acpi index='0' in device
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: libvirt
Version: 9.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: yalzhang@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-05 04:14 UTC by yafu
Modified: 2022-11-15 10:36 UTC (History)
7 users (show)

Fixed In Version: libvirt-8.1.0-1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-15 10:03:03 UTC
Type: Bug
Target Upstream Version: 8.1.0
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-106834 0 None None None 2022-01-05 04:21:20 UTC
Red Hat Product Errata RHSA-2022:8003 0 None None None 2022-11-15 10:03:22 UTC

Description yafu 2022-01-05 04:14:05 UTC
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:

Comment 1 Peter Krempa 2022-01-18 14:52:17 UTC
The fix is simple enough so we can fix this cosmetic issue.

Comment 2 Peter Krempa 2022-01-19 15:58:43 UTC
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 3 yalzhang@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 6 yalzhang@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.

Comment 8 errata-xmlrpc 2022-11-15 10:03:03 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 (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


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