Description of problem:
virt-xml-validate fail to validate interface xml
Version-Release number of selected component (if applicable):
# rpm -q libvirt netcf
Steps to Reproduce:
1. dump the xml file of the existing physical interface;
# virsh iface-dumpxml enp0s25
<interface type='ethernet' name='enp0s25'>
<ip address='10.66.5.0' prefix='22'/>
<ip address='fe80::1e6f:65ff:fe06:bc81' prefix='64'/>
<link speed='1000' state='up'/>
# virsh iface-dumpxml enp0s25 > net
2. virt-xml-validate failed to validate the xml file
# virt-xml-validate net
net:1: element interface: Relax-NG validity error : Expecting an element start, got nothing
net:1: element interface: Relax-NG validity error : Invalid sequence in interleave
net:1: element interface: Relax-NG validity error : Element interface failed to validate content
net fails to validate
virt-xml-validate fail to validate file dumped by iface-dumpxml
virt-xml-validate should successfully validate the file dumped by iface-dumpxml
Edit the physical interface by "virsh iface-edit" will not do the validation(no error pop up).
# virsh iface-edit enp0s25
Interface enp0s25 XML configuration edited.
I think "iface-edit" should do the validation because the xml has been edited.
Is this for netcf component or not? In any case, seems like the validation is
expecting some <start mode='xx'/> element.
There are RNG files in both libvirt and netcf. In this case it's the copy in libvirt, but the two should match.
I believe there are some missing <interleave> elements in the interface RNG
Actually it was much simpler than that - the <start> element should be optional but it isn't. I've sent patches upstream to both libvirt and netcf to remedy this:
verified on libvirt-3.2.0-1.el7.x86_64, the result is as expected.
# cat -n /usr/share/libvirt/schemas/interface.rng
281 <define name="startmode">
283 <element name="start">
284 <attribute name="mode">
289 <!-- Jim Fehlig lists the following that SuSe supports:
290 manual, ifplug, nfsroot -->
# virsh iface-list --all
Name State MAC Address
enp0s25 active 1c:6f:65:06:bc:81
lo active 00:00:00:00:00:00
# virsh iface-dumpxml enp0s25 > /tmp/net
# virt-xml-validate /tmp/net
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.