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 1174090 - extra space will be added to xml when update a network
Summary: extra space will be added to xml when update a network
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Ján Tomko
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-12-15 06:10 UTC by CongDong
Modified: 2015-03-05 07:48 UTC (History)
8 users (show)

Fixed In Version: libvirt-1.2.8-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 07:48:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0323 0 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2015-03-05 12:10:54 UTC

Description CongDong 2014-12-15 06:10:50 UTC
Description of problem:
After update a network, an extra space will be added to xml

Version-Release number of selected component (if applicable):
libvirt-1.1.1-29.el7_0.4.x86_64

How reproducible:
100%

Steps to Reproduce:
1. #cat test_network.xml
<network>
  <name>TestNetwork</name>
  <uuid>cd352758-369f-4d68-a0d9-e183bac0b92d</uuid>
  <forward mode='nat'>
    <nat>
      <port start='1024' end='65535'/>
    </nat>
  </forward>
  <bridge name='TestBr' stp='on' delay='0' />
  <mac address='52:54:00:b0:f3:4a'/>
  <ip address='192.168.111.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.111.2' end='192.168.111.254' />
    </dhcp>
  </ip>
</network>
2. # virsh net-define test_network.xml
3. # virsh net-start TestNetwork
4. # virsh net-update TestNetwork add-first ip-dhcp-host "<host mac='00:16:3e:77:e2:ed' name='foo.example.com' ip='192.168.122.10'/>"
5. # virsh net-dumpxml TestNetwork
<network>
  <name>TestNetwork</name>
  <uuid>cd352758-369f-4d68-a0d9-e183bac0b92d</uuid>
  <forward mode='nat'>
    <nat>
      <port start='1024' end='65535'/>
    </nat>
  </forward>
  <bridge name='TestBr' stp='on' delay='0' />
  <mac address='52:54:00:b0:f3:4a'/>
  <ip address='192.168.111.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.111.2' end='192.168.111.254' />
      <host mac='00:16:3e:77:e2:ed' name='foo.example.com' ip='192.168.122.10' />
    </dhcp>
  </ip>
</network>

Actual results:
After step 5, " <host mac='00:16:3e:77:e2:ed' name='foo.example.com' ip='192.168.122.10' />"
There is an extra space before "/>", this will cause our automation test FAIL.

Expected results:
There is no extra characters.

Additional info:
No extra character when test on 7u1.

This problem will affect our automation test result.
The extra space caused the result failed, it's hard to locate the error.
7.0.z should have the same behaviour with 7u1 for this operation.

Comment 2 Jiri Denemark 2014-12-15 12:37:42 UTC
This is already fixed in 7.1 by v1.1.1-240-gd8bd24a:

commit d8bd24a9ecce1eead3059621c4e3c5ad1c3a087f
Author: Ján Tomko <jtomko>
Date:   Tue Jul 30 14:36:08 2013 +0200

    Remove the space before the slash in network XML
    
    This matches the style we use elsewhere and allows
    nat-network-dns-srv-record{,-minimal}.xml to be tested in
    network XML -> XML test.

Comment 5 hongming 2015-01-04 06:24:24 UTC
Verify it as follows.The result is expected. Move its status to VERIFIED.

# rpm -q libvirt
libvirt-1.2.8-11.el7.x86_64

# virsh net-update TestNetwork add-first ip-dhcp-host "<host mac='00:16:3e:77:e2:ed' name='foo.example.com' ip='192.168.122.10'/>"
Updated network TestNetwork live state


# virsh net-dumpxml TestNetwork
<network>
  <name>TestNetwork</name>
  <uuid>cd352758-369f-4d68-a0d9-e183bac0b92d</uuid>
  <forward mode='nat'>
    <nat>
      <port start='1024' end='65535'/>
    </nat>
  </forward>
  <bridge name='TestBr' stp='on' delay='0'/>
  <mac address='52:54:00:b0:f3:4a'/>
  <ip address='192.168.111.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.111.2' end='192.168.111.254'/>
      <host mac='00:16:3e:77:e2:ed' name='foo.example.com' ip='192.168.122.10'/>
    </dhcp>
  </ip>
</network>

Comment 6 hongming 2015-01-04 06:28:27 UTC
Verify it using libvirt-1.2.8-1.el7.x86_64. The result is expected.

# rpm -q libvirt
libvirt-1.2.8-1.el7.x86_64

# virsh net-dumpxml TestNetwork
<network>
  <name>TestNetwork</name>
  <uuid>cd352758-369f-4d68-a0d9-e183bac0b92d</uuid>
  <forward mode='nat'>
    <nat>
      <port start='1024' end='65535'/>
    </nat>
  </forward>
  <bridge name='TestBr' stp='on' delay='0'/>
  <mac address='52:54:00:b0:f3:4a'/>
  <ip address='192.168.111.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.111.2' end='192.168.111.254'/>
      <host mac='00:16:3e:77:e2:ed' name='foo.example.com' ip='192.168.122.10'/>
    </dhcp>
  </ip>
</network>

Comment 8 errata-xmlrpc 2015-03-05 07:48:11 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.

https://rhn.redhat.com/errata/RHSA-2015-0323.html


Note You need to log in before you can comment on or make changes to this bug.