[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'>
   <memory unit='KiB'>1048576</memory>
     <interface type='bridge'>
       <filterref filter='myfilter'>
         <parameter name='CTRL_IP_LEARNING' value='none'/>
         <parameter name='DHCPSERVER' value=''/>
         <parameter name='IP' value=''/>
         <parameter name='IP6_ADDR' value='2001:19f0:300:2102::'/>
         <parameter name='IP6_MASK' value='64'/>

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_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"/>
+       <zeroOrMore>
        <element name="parameter">
          <attribute name="name">
            <ref name="filter-param-name"/>
@@ -4476,6 +4477,7 @@
            <ref name="filter-param-value"/>
+       </zeroOrMore>

More information about the libvirt-users mailing list