WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] network-bridge: Fix for bonding

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] network-bridge: Fix for bonding
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 22 Apr 2009 07:00:26 -0700
Delivery-date: Wed, 22 Apr 2009 07:02:15 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1240395997 -3600
# Node ID cdc044f665dc71ec819d3a0ff8262b235274d8d6
# Parent  6ba4e34d21d33509c5f64b1f8feb95bc4a1577a4
network-bridge: Fix for bonding

If ${netdev} is bonding, brctl addif ${bridge} ${pdev} fails:
  can't add ${pdev} to bridge ${bridge}: Invalid argument
Because ${pdev} has no slaves at this point.=20
# Notice that ifdown ${netdev} clears slaves of ${netdev}.

This patch restores slaves before add_to_bridge2 ${bridge} ${pdev}.

Signed-off-by: KUWAMURA Shin'ya <kuwa@xxxxxxxxxxxxxx>
---
 tools/hotplug/Linux/network-bridge |    9 +++++++++
 1 files changed, 9 insertions(+)

diff -r 6ba4e34d21d3 -r cdc044f665dc tools/hotplug/Linux/network-bridge
--- a/tools/hotplug/Linux/network-bridge        Tue Apr 21 16:31:26 2009 +0100
+++ b/tools/hotplug/Linux/network-bridge        Wed Apr 22 11:26:37 2009 +0100
@@ -223,6 +223,10 @@ op_start () {
 
     preiftransfer ${netdev}
     transfer_addrs ${netdev} ${tdev}
+    # Remember slaves for bonding interface.
+    if [ -e /sys/class/net/${netdev}/bonding/slaves ]; then
+       slaves=`cat /sys/class/net/${netdev}/bonding/slaves`
+    fi
     # Remember the IP details for do_ifup.
     get_ip_info ${netdev}
     if ! ifdown ${netdev}; then
@@ -234,6 +238,11 @@ op_start () {
 
     setup_bridge_port ${pdev}
 
+    # Restore slaves
+    if [ -n "${slaves}" ]; then
+       ip link set ${pdev} up
+       ifenslave ${pdev} ${slaves}
+    fi
     add_to_bridge2 ${bridge} ${pdev}
     do_ifup ${bridge}
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] network-bridge: Fix for bonding, Xen patchbot-unstable <=