[libvirt-users] Issues with XML validation after upgrade to 1.2.12

Brian Rak brak at gameservers.com
Tue Mar 10 15:31:17 UTC 2015


After we upgraded to 1.2.12, we've been having issues with libvirt... it 
complains that our formerly valid guest definitions are now invalid:

error: Failed to start domain XXXX
error: internal error: Cannot instantiate filter due to unresolvable 
variables or unavailable list elements: DHCPSERVER

We looked into this, and found that it's the XML validation that's failing:

# xmllint --noout --relaxng "/share/libvirt/schemas/domain.rng" 
XXXX.xml  --recover
Relax-NG validity error : Extra element devices in interleave
test.xml:1: element domain: Relax-NG validity error : Element domain 
failed to validate content
test.xml fails to validate

And, a minimal domain XML to reproduce it (this won't boot, but it shows 
the issue):

<domain type='kvm' id='65'>
   <name>XXXX</name>
   <uuid>b602b5f2-b9d7-43bd-a949-acc7eeeb9f8f</uuid>
   <memory unit='KiB'>1048576</memory>
   <devices>
     <interface type='bridge'>
       <filterref filter='myfilter'>
         <parameter name='CTRL_IP_LEARNING' value='none'/>
         <parameter name='DHCPSERVER' value='104.156.226.10'/>
         <parameter name='IP' value='104.207.129.11'/>
         <parameter name='IP6_ADDR' value='2001:19f0:300:2102::'/>
         <parameter name='IP6_MASK' value='64'/>
       </filterref>
     </interface>
   </devices>
</domain>

The cause seems to be having multiple parameters in a <filterref> block.

We applied the following patch to fix it:

diff -ur src_clean/docs/schemas/domaincommon.rng 
src/docs/schemas/domaincommon.rng
--- src_clean/docs/schemas/domaincommon.rng     2015-01-23 
06:46:24.000000000 -0500
+++ src/docs/schemas/domaincommon.rng   2015-03-10 11:30:42.057441342 -0400
@@ -4468,6 +4468,7 @@
        <data type="NCName"/>
      </attribute>
      <optional>
+       <zeroOrMore>
        <element name="parameter">
          <attribute name="name">
            <ref name="filter-param-name"/>
@@ -4476,6 +4477,7 @@
            <ref name="filter-param-value"/>
          </attribute>
        </element>
+       </zeroOrMore>
      </optional>
    </define>




More information about the libvirt-users mailing list