Bug 907769

Summary: virsh net-update can add multiple dhcp sections to ipv4 in network.
Product: Red Hat Enterprise Linux 7 Reporter: hongming <honzhang>
Component: libvirtAssignee: Jiri Denemark <jdenemar>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: high    
Version: 7.0CC: acathrow, cwei, dyuan, mzhan
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-04-11 08:19:39 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 hongming 2013-02-05 08:46:54 UTC
Description of problem:
virsh net-update can add multiple dhcp sections to ipv4 in network. 

Version-Release number of selected component (if applicable):
libvirt-0.10.2-18.el6.x86_64 

How reproducible:
100% 

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

# virsh net-start mynetwork
Network mynetwork started

# virsh net-dumpxml mynetwork
<network>
<name>mynetwork</name>
<uuid>6e9bb2dd-b99d-630f-39d1-b69a806da550</uuid>
<forward mode='nat'/>
<bridge name='virbr1' stp='on' delay='0' />
<mac address='52:54:00:E5:B6:95'/>
<ip address='192.168.121.2' netmask='255.255.255.0'>
</ip>
<ip address='192.168.10.2' netmask='255.255.255.0'>
</ip>
</network>

# virsh net-update mynetwork add ip-dhcp-host "<host mac='00:11:22:33:44:55' ip='192.168.122.45'/>" --live --config --parent-index 0
Updated network mynetwork persistent config and live state

# virsh net-update mynetwork add ip-dhcp-host "<host mac='00:11:22:33:44:56' ip='192.168.122.46'/>" --live --config --parent-index 1
Updated network mynetwork persistent config and live state


# virsh net-dumpxml mynetwork<network>
<name>mynetwork</name>
<uuid>6e9bb2dd-b99d-630f-39d1-b69a806da550</uuid>
<forward mode='nat'/>
<bridge name='virbr1' stp='on' delay='0' />
<mac address='52:54:00:E5:B6:95'/>
<ip address='192.168.121.2' netmask='255.255.255.0'>
<dhcp>
<host mac='00:11:22:33:44:55' ip='192.168.122.45' />
</dhcp>
</ip>
<ip address='192.168.10.2' netmask='255.255.255.0'>
<dhcp>
<host mac='00:11:22:33:44:56' ip='192.168.122.46' />
</dhcp>
</ip>
</network>

# virsh net-destroy mynetwork
Network mynetwork destroyed

# virsh net-start mynetwork
Network mynetwork started 
  
Actual results:
as above 

Expected results:
Check for multiple DHCP sections
for example , the following error should occurs.

# virsh net-dumpxml mynetwork > mynetwork.xml

# virsh net-define mynetwork.xml
error: Failed to define network from mynetwork.xml
error: unsupported configuration: Multiple dhcp sections found. dhcp is supported only for a single IPv4 address on each network 

Additional info:

Comment 1 hongming 2013-02-05 08:56:30 UTC
virsh net-start also doesn't check for multiple DHCP sections in network.

Comment 2 hongming 2013-05-27 03:06:08 UTC
Clone of 
(rhel7) Bug 907779 - virsh net-update can add multiple dhcp sections to ipv4 in network

Comment 6 Jiri Denemark 2014-04-04 21:37:41 UTC
This bug was not selected to be addressed in Red Hat Enterprise Linux 6. We will look at it again within the Red Hat Enterprise Linux 7 product.

Comment 7 Jiri Denemark 2014-04-11 08:19:39 UTC

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