rpms/xen/FC-5 xen-network-bonding-fix.patch, NONE, 1.1 xen.spec, 1.123, 1.124

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Tue Apr 3 13:28:18 UTC 2007


Author: armbru

Update of /cvs/dist/rpms/xen/FC-5
In directory cvs.devel.redhat.com:/tmp/cvs-serv25501

Modified Files:
	xen.spec 
Added Files:
	xen-network-bonding-fix.patch 
Log Message:
fix ethernet bonding in balanced-rr mode

xen-network-bonding-fix.patch:
 network-bridge |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

--- NEW FILE xen-network-bonding-fix.patch ---
Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>

--- a/tools/examples/network-bridge	2007-03-08 09:42:35.000000000 +1100
+++ b/tools/examples/network-bridge	2007-03-08 09:46:18.000000000 +1100
@@ -70,12 +70,20 @@
 vif0="vif0.${vifnum}"
 
 get_ip_info() {
-    addr_pfx=`ip addr show dev $1 | egrep '^ *inet' | sed -e 's/ *inet //' -e 's/ .*//'`
+    addr_pfx=`ip addr show dev $1 | sed -n 's/^ *inet \(.*\) [^ ]*$/\1/p'`
     gateway=`ip route show dev $1 | fgrep default | sed 's/default via //'`
 }
+
+is_bonding() {
+    [ -f "/sys/class/net/$1/bonding/slaves" ]
+}
+
+is_ifup() {
+    ip link show dev $1 | awk '{ exit $3 !~ /[<,]UP[,>]/ }'
+}
     
 do_ifup() {
-    if ! ifup $1 ; then
+    if ! ifup $1 || ! is_ifup $1 ; then
         if [ ${addr_pfx} ] ; then
             # use the info from get_ip_info()
             ip addr flush $1
@@ -206,8 +214,8 @@
 	mac=`ip link show ${netdev} | grep 'link\/ether' | sed -e 's/.*ether \(..:..:..:..:..:..\).*/\1/'`
 	preiftransfer ${netdev}
 	transfer_addrs ${netdev} ${vdev}
-	if ! ifdown ${netdev}; then
-	    # If ifdown fails, remember the IP details.
+	if is_bonding ${netdev} || ! ifdown ${netdev}; then
+	    # Remember the IP details if necessary.
 	    get_ip_info ${netdev}
 	    ip link set ${netdev} down
 	    ip addr flush ${netdev}


Index: xen.spec
===================================================================
RCS file: /cvs/dist/rpms/xen/FC-5/xen.spec,v
retrieving revision 1.123
retrieving revision 1.124
diff -u -r1.123 -r1.124
--- xen.spec	14 Mar 2007 20:14:47 -0000	1.123
+++ xen.spec	3 Apr 2007 13:28:16 -0000	1.124
@@ -3,7 +3,7 @@
 Summary: Xen is a virtual machine monitor
 Name:    xen
 Version: 3.0.3
-Release: 5%{?dist}
+Release: 6%{?dist}
 Group:   Development/Libraries
 License: GPL
 URL:     http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html
@@ -51,10 +51,11 @@
 Patch39: xen-shadow-enable.patch
 Patch40: xen-man-pages.patch
 
-Patch42: xen-qemu-close-fds.patch
+Patch42: xen-network-bonding-fix.patch
 
 Patch80: xen-destroydevice-args.patch
 Patch81: xen-hotplug-error-reporting.patch
+Patch82: xen-qemu-close-fds.patch
 
 # Ignore module loading for old Dom0/DomU split kernels
 Patch85: xen-initscript-mods.patch
@@ -187,13 +188,15 @@
 # Sanitize man pages
 %patch40 -p1
 
-# Close QEMU file handles when running network script
+# network bonding fix
 %patch42 -p1
 
 # fix HVM cannot allocate memory bug
 %patch80 -p1
 # hotplug script error reporting
 %patch81 -p1
+# Close QEMU file handles when running network script
+%patch82 -p1
 
 # Ignore module loading for old Dom0/DomU split kernels
 %patch85 -p1
@@ -324,6 +327,9 @@
 %dir %attr(0700,root,root) /var/log/xen
 
 %changelog
+* Mon Apr 02 2007 Markus Armbruster <armbru at redhat.com>
+- fix ethernet bonding in balanced-rr mode
+
 * Wed Mar 14 2007 Daniel P. Berrange <berrange at redhat.com> - 3.0.3-5.fc5
 - Disable access to QEMU monitor over VNC (CVE-2007-0998, bz 230295)
 




More information about the fedora-cvs-commits mailing list