[ovs-dev] [suse 7/7] xenserver: Remove Linux bridge on startup if no bridges exist.

Ben Pfaff blp at nicira.com
Wed Dec 15 19:19:04 UTC 2010


From: Patrick Mullaney <pm.mullaney at gmail.com>

Otherwise, if the bridge module is loaded but no bridges exist, on all
but the most recent Linux kernels this prevents the Open vSwitch kernel
module from loading.

Signed-off-by: Ben Pfaff <blp at nicira.com>
---
Patrick--this patch is missing your Signed-off-by, could you send it?
Thanks.

diff --git a/xenserver/etc_init.d_openvswitch b/xenserver/etc_init.d_openvswitch
index 74ada6f..5072775 100755
--- a/xenserver/etc_init.d_openvswitch
+++ b/xenserver/etc_init.d_openvswitch
@@ -181,6 +181,14 @@ function remove_all_dp {
 }
 
 function insert_modules_if_required {
+    if test -e /sys/module/bridge; then
+	bridges=`echo /sys/class/net/*/bridge | sed 's,/sys/class/net/,,g;s,/bridge,,g'`
+	if test "$bridges" != "*"; then
+            log_warning_msg "not removing bridge module because bridges exist ($bridges)"
+        else
+            action "removing bridge module" rmmod bridge
+        fi
+    fi
     if ! lsmod | grep -q "openvswitch_mod"; then
         action "Inserting llc module" modprobe llc
         action "Inserting openvswitch module" modprobe openvswitch_mod
-- 
1.7.1





More information about the dev mailing list