Bug 1004365

Summary: libvirt network schema isn't valid
Product: Red Hat Enterprise Linux 6 Reporter: Pavel Hrdina <phrdina>
Component: libvirtAssignee: Ján Tomko <jtomko>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.5CC: acathrow, bili, chhu, dyuan, honzhang, jtomko, mjenner
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-0.10.2-24.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1004364 Environment:
Last Closed: 2013-11-21 09:10:00 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:
Bug Depends On: 1004364    
Bug Blocks:    

Description Pavel Hrdina 2013-09-04 13:41:01 UTC
+++ This bug was initially created as a clone of Bug #1004364 +++

Description of problem:
The network.rng schema isn't valid. There is missing element "nat" for "forward" element. The new features have been added by commits 905629f4 and 1716e7a6.

Version-Release number of selected component (if applicable):
upstream

How reproducible:
100%

Steps to Reproduce:
1. virsh net-dumpxml default > default.xml
2. virt-xml-validate default.xml network

Actual results:
Relax-NG validity error : Extra element forward in interleave
default.xml:4: element forward: Relax-NG validity error : Element network failed to validate content
default.xml fails to validate

Expected results:
default.xml validates

Comment 2 Ján Tomko 2013-09-05 12:01:02 UTC
Now fixed upstream:
commit 437b7944a81b648a15c657fef184f3bcd2427dac
Author:     Ján Tomko <jtomko>
AuthorDate: 2013-09-05 11:08:38 +0200
Commit:     Ján Tomko <jtomko>
CommitDate: 2013-09-05 13:45:49 +0200

    Add '<nat>' element to '<forward>' network schemas
    
    Commits 905629f4 and 1716e7a6 have added support for specifying
    an IPv4 range and a port range to be used by NAT:
    <forward mode='nat'>
      <nat>
        <address start='10.20.30.40' end='10.20.30.44'/>
        <port start='60000' end='65432'/>
      </nat>
    </forward>
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1004364

git describe: v1.1.2-71-g437b794

Comment 5 chhu 2013-09-10 03:43:02 UTC
Reproduced with libvirt-0.10.2-23.el6.x86_64.

Verified with the packages:
libvirt-0.10.2-24.el6.x86_64
qemu-kvm-0.12.1.2-2.400.el6.x86_64

Test steps:
1. # cat n1.xml
<network connections='1'>
  <name>default</name>
  <uuid>ba6533c2-da83-4e95-bf35-5dac8ab3beee</uuid>
  <forward mode='nat'>
    <nat>
      <port start='1024' end='65535'/>
    </nat>
  </forward>
  <bridge name='virbr0' stp='on' delay='0' />
  <mac address='52:54:00:b7:53:29'/>
  <ip address='192.168.122.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.122.2' end='192.168.122.254' />
    </dhcp>
  </ip>
</network>

2. # virt-xml-validate n1.xml network
n1.xml validates

3. # cat n2.xml
<network>
  <name>default</name>
  <uuid>822f0d90-c91e-6742-64da-4a736edb9a9b</uuid>
  <bridge name="virbr0"/>
  <forward mode="nat" dev="eth1">
    <nat>
      <address start='10.20.30.40' end='10.20.30.44'/>
      <port start='60000' end='65432'/>
    </nat>
  </forward>
  <ip address="192.168.122.1" netmask="255.255.255.0">
    <dhcp>
      <range start="192.168.122.2" end="192.168.122.254"/>
      <host mac="00:16:3e:77:f2:ed" name="a.example.com" ip="192.168.122.10"/>
      <host mac="00:16:3e:3e:a2:1a" name="b.example.com" ip="192.168.122.11"/>
    </dhcp>
  </ip>
  <ip family="ipv4" address="192.168.123.1" netmask="255.255.255.0">
  </ip>
  <ip family="ipv6" address="2001:db8:ac10:fe01::1" prefix="64">
  </ip>
  <ip family="ipv6" address="2001:db8:ac10:fd01::1" prefix="64">
  </ip>
  <ip family="ipv4" address="10.24.10.1">
  </ip>
</network>

4. # virt-xml-validate n2.xml network
n2.xml validates

Test results:
current command works well, change the status to verified.

Comment 7 errata-xmlrpc 2013-11-21 09:10:00 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.

http://rhn.redhat.com/errata/RHBA-2013-1581.html