Bug 1223688
| Summary: | virt-xml-validate should accept both DHCPv4 and static IPv4 addresses concurrently | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Hu Jianwei <jiahu> |
| Component: | libvirt | Assignee: | Laine Stump <laine> |
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 7.1 | CC: | dyuan, honzhang, laine, mzhan, rbalakri, shyu |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-1.2.16-1.el7 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-11-19 06:31:27 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: | |||
You are correct. libvirt's interface.rng should mirror netcf's, but I forgot to update it when I added new capabilities to netcf. Fix posted upstream, awaiting review: https://www.redhat.com/archives/libvir-list/2015-May/msg00746.html Pushed upstream, will be in 1.2.16:
commit ba5566e80f95618c3bb8ac327d4a1c370539166d
Author: Laine Stump <laine>
Date: Thu May 21 11:26:52 2015 -0400
interface: allow multiple IPv4 addresses + dhcp on a single interface
Verify this bug with
libvirt-client-1.2.17-2.el7.x86_64
libvirt-1.2.17-2.el7.x86_64
# virt-xml-validate /dev/stdin <<EOF
<interface type='ethernet' name='eth1'>
<start mode='none'/>
<mac address='00:1B:21:27:4E:CE'/>
<mtu size='1500'/>
<protocol family='ipv4'>
<dhcp/>
<ip address='192.168.1.111' prefix='24'/>
</protocol>
<protocol family='ipv6'>
<dhcp/>
<ip address='2001:db8:ca2:2::1' prefix='64'/>
</protocol>
</interface>
EOF
/dev/stdin validates
# virt-xml-validate /dev/stdin <<EOF
<interface type='ethernet' name='eth1'>
<start mode='none'/>
<mac address='00:1B:21:27:4E:CE'/>
<mtu size='1500'/>
<protocol family='ipv4'>
<dhcp/>
<ip address='192.168.1.111' prefix='24'/>
</protocol>
</interface>
EOF
/dev/stdin validates
# virt-xml-validate /dev/stdin <<EOF
<interface type='ethernet' name='eth1'>
<start mode='none'/>
<mac address='00:1B:21:27:4E:CE'/>
<mtu size='1500'/>
<protocol family='ipv6'>
<dhcp/>
<ip address='2001:db8:ca2:2::1' prefix='64'/>
</protocol>
</interface>
EOF
/dev/stdin validates
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://rhn.redhat.com/errata/RHBA-2015-2202.html |
Description of problem: virt-xml-validate should accept both DHCPv4 and static IPv4 addresses concurrently Version-Release number of selected component (if applicable): libvirt-client-1.2.15-2.el7.x86_64 How reproducible: 100% Steps to Reproduce: [root@localhost ~]# cat eth1.xml <interface type='ethernet' name='eth1'> <start mode='none'/> <mac address='00:1B:21:27:4E:CE'/> <mtu size='1500'/> <protocol family='ipv4'> <dhcp/> <ip address='192.168.1.111' prefix='24'/> </protocol> <protocol family='ipv6'> <dhcp/> <ip address='2001:db8:ca2:2::1' prefix='64'/> </protocol> </interface> [root@localhost ~]# virt-xml-validate eth1.xml Relax-NG validity error : Extra element protocol in interleave eth1.xml:5: element protocol: Relax-NG validity error : Element interface failed to validate content eth1.xml:3: element mac: Relax-NG validity error : Invalid sequence in interleave eth1.xml fails to validate Actual results: As shown above steps, AFAIK,libvirt should be same as netcf, we need a patch for /usr/share/libvirt/schemas/interface.rng Expected results: Fix it. Additional info: Please refer to below netcf bug: Bug 1113983 - netcf should allow interfaces to be configured with both DHCPv4 and static IPv4 addresses at the same time https://git.fedorahosted.org/cgit/netcf.git/commit/?id=0013d5a2ccf61e58b021feead6ed66813ee50f65 Using below schemas(/usr/share/libvirt/schemas/interface.rng), libvirt can handle the bug. <define name="protocol-ipv4"> <element name="protocol"> <attribute name="family"> <value>ipv4</value> </attribute> <interleave> <optional> <ref name="dhcp-element"/> </optional> <oneOrMore> <element name="ip"> <attribute name="address"><ref name="ipv4Addr"/></attribute> <optional> <attribute name="prefix"><ref name="ipv4Prefix"/></attribute> </optional> </element> </oneOrMore> <optional> <element name="route"> <attribute name="gateway"><ref name="ipv4Addr"/></attribute> </element> </optional> </interleave> </element> </define> [root@localhost ~]# virt-xml-validate eth1.xml eth1.xml validates