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 767057 - forward mode='bridge' macvtap xml with invalid section(bridge and ip section) can be defined and started
Summary: forward mode='bridge' macvtap xml with invalid section(bridge and ip section)...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: 7.0
Assignee: Laine Stump
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-12-13 05:01 UTC by xhu
Modified: 2014-06-18 00:40 UTC (History)
7 users (show)

Fixed In Version: libvirt-1.0.1-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 10:06:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description xhu 2011-12-13 05:01:51 UTC
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:

Comment 4 Laine Stump 2012-12-05 19:18:25 UTC
Fix sent upstream:

https://www.redhat.com/archives/libvir-list/2012-December/msg00235.html

Comment 5 Laine Stump 2012-12-06 00:00:28 UTC
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).

Comment 6 Huang Wenlong 2012-12-20 06:11:32 UTC
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')

Comment 7 Ludek Smid 2014-06-13 10:06:12 UTC
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.


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