Hide Forgot
Description of problem: forward mode='bridge' macvtap xml with invalid section(bridge and ip section) can be defined and started Version-Release number of selected component (if applicable): libvirt-0.9.8-1.el6.x86_64 qemu-kvm-0.12.1.2-2.209.el6.x86_64 kernel-2.6.32-220.el6.x86_64 How reproducible: everytimes Steps to Reproduce: 1. prepare forward mode='bridge' macvtap xml with dhcp section # cat macvtap-bridge-test.xml <network> <name>test</name> <forward dev='eth0' mode='bridge'> <interface dev='eth0'/> <interface dev='eth3'/> </forward> <bridge name='test'/> <ip address='192.168.200.1' netmask='255.255.255.0'> <dhcp> <range start='192.168.200.2' end='192.168.200.254' /> </dhcp> </ip> </network> 2. define and start network test: # virsh net-define macvtap-bridge-test.xml Network test defined from macvtap-bridge-test.xml # virsh net-start test Network test started 3. check test network xml: <network> <name>test</name> <uuid>518e50e7-38dc-3441-3e4c-8f9fb536fb8f</uuid> <forward dev='eth0' mode='bridge'> <interface dev='eth0'/> <interface dev='eth3'/> </forward> <bridge name='test' /> <ip address='192.168.200.1' netmask='255.255.255.0'> <dhcp> <range start='192.168.200.2' end='192.168.200.254' /> </dhcp> </ip> </network> Actual results: forward mode='bridge' macvtap xml with invalid section(bridge and ip section) can be defined and started Expected results: when the above network xml is defined, invalid xml section error should raised. Additional info:
Fix sent upstream: https://www.redhat.com/archives/libvir-list/2012-December/msg00235.html
Pushed upstream. Will be in libvirt-1.0.1. commit fd54f1de536ebd5f7566285b83029e6c73725d03 Author: Laine Stump <laine> Date: Wed Dec 5 14:10:24 2012 -0500 network: prevent a few invalid configuration combinations This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=767057 It was possible to define a network with <forward mode='bridge'> that had both a bridge device and a forward device defined. These two are mutually exclusive by definition (if you are using a bridge device, then this is a host bridge, and if you have a forward dev defined, this is using macvtap). It was also possible to put <ip>, <dns>, and <domain> elements in this definition, although those aren't supported by the current driver (although it's conceivable that some other driver might support that). The items that are invalid by definition, are now checked in the XML parser (since they will definitely *always* be wrong), and the others are checked in networkValidate() in the network driver (since, as mentioned, it's possible that some other network driver, or even this one, could some day support setting those).
Verify this bug with: libvirt-1.0.1-1.el7.x86_64 #cat net.xml <network> <name>test</name> <forward dev='eth0' mode='bridge'> <interface dev='eth0'/> <interface dev='eth3'/> </forward> <bridge name='test'/> <ip address='192.168.200.1' netmask='255.255.255.0'> <dhcp> <range start='192.168.200.2' end='192.168.200.254' /> </dhcp> </ip> </network> #virsh net-define net.xml error: Failed to define network from net.xml error: XML error: A network with forward mode='bridge' can specify a bridge name or a forward dev, but not both (network 'test')
This request was resolved in Red Hat Enterprise Linux 7.0. Contact your manager or support representative in case you have further questions about the request.