aboutsummaryrefslogtreecommitdiff
path: root/xenserver/etc_init.d_openvswitch
diff options
context:
space:
mode:
authorPatrick Mullaney <pm.mullaney@gmail.com>2010-12-15 11:07:10 -0800
committerBen Pfaff <blp@nicira.com>2011-01-07 10:31:30 -0800
commit8d2662a5791cd2aaa230ed829e018cb4b059fee7 (patch)
tree15ac5ab16b92b3543f55dfd9399cb34ec777223e /xenserver/etc_init.d_openvswitch
parentd56d35d2f4ef15c90fae7649887f6b8dc8993b97 (diff)
xenserver: Remove Linux bridge on startup if no bridges exist.
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@nicira.com>
Diffstat (limited to 'xenserver/etc_init.d_openvswitch')
-rwxr-xr-xxenserver/etc_init.d_openvswitch8
1 files changed, 8 insertions, 0 deletions
diff --git a/xenserver/etc_init.d_openvswitch b/xenserver/etc_init.d_openvswitch
index fc89a3e9..b87d5ae1 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