Bug 1456165 - The sub-element for panic device should be "interleave" in rng file
Summary: The sub-element for panic device should be "interleave" in rng file
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.4
Hardware: x86_64
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Erik Skultety
QA Contact: Lili Zhu
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-27 10:20 UTC by Fangge Jin
Modified: 2018-10-30 09:52 UTC (History)
6 users (show)

Fixed In Version: libvirt-4.4.0-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-30 09:49:58 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:3113 None None None 2018-10-30 09:52:27 UTC

Description Fangge Jin 2017-05-27 10:20:27 UTC
Description of problem:
The sub-element for panic device should be "interleave" in rng file

Version-Release number of selected component:
libvirt-3.2.0-6.virtcov.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Check the definition of panic device in domaincommon.rng:
# cat /usr/share/libvirt/schemas/domaincommon.rng
......
  <define name="panic">
    <element name="panic">
      <optional>
        <attribute name="model">
          <choice>
            <value>isa</value>
            <value>pseries</value>
            <value>hyperv</value>
            <value>s390</value>
          </choice>
        </attribute>
      </optional>
      <optional>
        <ref name="alias"/>
      </optional>
      <optional>
        <ref name="address"/>
      </optional>
    </element>
  </define>
......

2.
1) Prepare a guest xml with panic device like below:
# cat vm1.xml
......
    <panic model='isa'>
      <alias name='panic0'/>
      <address type='isa' iobase='0x505'/>
    </panic>
......

2) Validate it:
# virt-xml-validate /tmp/vm1.xml 
/tmp/vm1.xml validates

3.
1) Switch the order of alias and address:
# cat vm1.xml
......
    <panic model='isa'>
      <address type='isa' iobase='0x505'/>
      <alias name='panic0'/>
    </panic>
......

2) Validate again:
# virt-xml-validate /tmp/vm1.xml 
Relax-NG validity error : Extra element devices in interleave
/tmp/vm1.xml:39: element devices: Relax-NG validity error : Element domain failed to validate content
/tmp/vm1.xml fails to validate


Actual results:
In step3, xml validation failed.

Expected results:
In step3, xml validation should succeed. This requires that the sub-element for panic device be "interleave" in rng, like:
  <define name="panic">
    <element name="panic">
      <optional>
        <attribute name="model">
          <choice>
            <value>isa</value>
            <value>pseries</value>
            <value>hyperv</value>
            <value>s390</value>
          </choice>
        </attribute>
      </optional>
    **<interleave>**
        <optional>
          <ref name="alias"/>
        </optional>
        <optional>
          <ref name="address"/>
        </optional>
    **</interleave>**
    </element>
  </define>

Additional info:
And I can't find alias info for panic device in active dumpxml after start guest successfully.

Comment 1 Erik Skultety 2018-05-02 13:03:56 UTC
Fixed upstream by:
commit c376c7699645d315c7bb8a936cfe19e24d729b65
Author:     Erik Skultety <eskultet@redhat.com>
AuthorDate: Wed May 2 13:54:55 2018 +0200
Commit:     Erik Skultety <eskultet@redhat.com>
CommitDate: Wed May 2 14:52:09 2018 +0200

    docs: schema: Add missing <interleave> element to panic device
    
    Panic device has 2 optional sub-elements - <alias> and <address> the
    order of which should be interchangeable in the XML.
    
    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1456165

Comment 3 Lili Zhu 2018-06-14 13:35:25 UTC
Verify this bug with:
libvirt-4.4.0-2.el7.x86_64

steps:
1) Prepare a guest xml with panic device like below:
# cat vm1.xml
......
  <panic model='isa'>
      <address type='isa' iobase='0x505'/>
      <alias name='ua-70080af6-afec-4398-9c91-e431d05319e8'/>
  </panic>
......

2) Validate it:
# virt-xml-validate vm1.xml 
vm1.xml validates
 
As the result match with expected result, mark it as verified

Comment 5 errata-xmlrpc 2018-10-30 09:49:58 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/RHSA-2018:3113


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