Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1004627

Summary: virt-xml-validate should succeed xml dumpxml from net-dumpxml
Product: Red Hat Enterprise Linux 7 Reporter: EricLee <bili>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: acathrow, dyuan, hliu, jdenemar, mzhan
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-05 07:51:29 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:

Description EricLee 2013-09-05 05:24:21 UTC
Description of problem:
virt-xml-validate should succeed xml dumpxml from net-dumpxml

Version-Release number of selected component (if applicable):
# rpm -qa libvirt qemu-kvm ; uname -r
qemu-kvm-1.5.3-2.el7.x86_64
libvirt-1.1.1-3.el7.x86_64
3.10.0-14.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
# virsh net-list --all
 Name                 State      Autostart     Persistent
----------------------------------------------------------
 default              active     yes           yes

# virsh net-dumpxml default > default.xml

# vim default.xml
<network connections='1'>
  <name>default</name>
  <uuid>107ae75e-cfb1-4e86-90a8-b145c44502df</uuid>
  <forward mode='nat'>
    <nat>
      <port start='1024' end='65535'/>
    </nat>
  </forward>
  <bridge name='virbr0' stp='on' delay='0' />
  <mac address='52:54:00:1c:4f:78'/>
  <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>

# virt-xml-validate default.xml network
default.xml:5: element nat: Relax-NG validity error : Element forward has extra content: nat
Relax-NG validity error : Extra element forward in interleave
default.xml:1: element network: Relax-NG validity error : Element network failed to validate content
default.xml fails to validate

Actual results:
see description

Expected results:
should succeed

Additional info:
However, do net-dumpxml then virt-xml-validate in RHEL6.5 will succeed, and net-dumpxml gets no 'connections' and
    <nat>
      <port start='1024' end='65535'/>
    </nat>
in default.xml:
# vim default.xml
<network>
  <name>default</name>
  <uuid>d3e7c338-78b7-4a6c-b221-a115a48bb062</uuid>
  <forward mode='nat'/>
  <bridge name='virbr0' stp='on' delay='0' />
  <mac address='52:54:00:CA:89:0F'/>
  <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>

It is a new feature added in 1.0.3 according to:
http://libvirt.org/formatnetwork.html, but not modify virt-xml-validate correspondingly.

Comment 2 Jiri Denemark 2013-09-05 07:51:29 UTC

*** This bug has been marked as a duplicate of bug 1004364 ***