Red Hat Bugzilla – Bug 735950
The network xml with mutiple dhcp sections can be defined and started successfully although there is prompt error
Last modified: 2012-06-20 02:31:05 EDT
Description of problem: The network xml with mutiple dhcp sections can be defined successfully although there is prompt error Version-Release number of selected component (if applicable): libvirt-0.9.4-7.el6.x86_64 qemu-kvm-0.12.1.2-2.185.el6.x86_64 kernel-2.6.32-193.el6.x86_64 How reproducible: everytimes Steps to Reproduce: 1. prepare the following network xml with multiple dhcp sections: # cat multi-dhcp.xml <network> <name>multi-dhcp</name> <forward mode='nat'/> <bridge name='virbr10' stp='on' delay='0' /> <ip address='192.168.201.1' netmask='255.255.255.0'> <dhcp> <range start='192.168.201.2' end='192.168.201.254' /> </dhcp> </ip> <ip address='192.168.202.1' netmask='255.255.255.0'> <dhcp> <range start='192.168.202.2' end='192.168.202.254' /> </dhcp> </ip> <ip family='ipv6' address='2003:db8:ac10:fe01::1' prefix='64'> </ip> </network> 2. define and start the multi-dhcp network # virsh net-define multi-dhcp.xml error: Failed to define network from multi-dhcp.xml error: unsupported configuration: Multiple dhcp sections found. dhcp is supported only for a single IPv4 address on each network # echo $? 1 # virsh net-list --all Name State Autostart ----------------------------------------- multi-dhcp inactive no # virsh net-start multi-dhcp Network multi-dhcp started Actual results: The network xml with mutiple dhcp sections can succeed be defined and started although there is prompt error Expected results: The network xml with mutiple dhcp sections can not be defined and started successfully Additional info:
Fixed with upstream commit: commit 0763a26dfef240e301e19b9c563c10462e72f255 Author: Peter Krempa <pkrempa@redhat.com> Date: Wed Nov 30 15:26:25 2011 +0100 bridge_driver: Don't define network if XML contains more IPv4 adreses. Only one IPv4 DHCP definition is supported. Originally the code checked for a multiple definition and returned an error, but the new domain definition was already added to networks. This patch moves the check before the newly defined network is added to active networks. *src/network/bridge_driver.c: networkDefine(): - move multiple IPv4 addresses check before definition is used. Tested with XML provided in report: virsh # net-define network.xml error: Failed to define network from network.xml error: unsupported configuration: Multiple dhcp sections found. dhcp is supported only for a single IPv4 address on each network virsh # net-list --all Name State Autostart ----------------------------------------- default active yes virsh #
Verify it with libvirt-0.9.9-1.el6 and it passed.
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: No Documentation needed
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/RHSA-2012-0748.html