Bug 1456165

Summary: The sub-element for panic device should be "interleave" in rng file
Product: Red Hat Enterprise Linux 7 Reporter: Fangge Jin <fjin>
Component: libvirtAssignee: Erik Skultety <eskultet>
Status: CLOSED ERRATA QA Contact: Lili Zhu <lizhu>
Severity: low Docs Contact:
Priority: low    
Version: 7.4CC: dyuan, eskultet, jdenemar, xuzhang, yafu, zpeng
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-4.4.0-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-30 09:49:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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>
AuthorDate: Wed May 2 13:54:55 2018 +0200
Commit:     Erik Skultety <eskultet>
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