Skip to content

Commit 8d2662a

Browse files
pmullaneyblp
authored andcommitted
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>
1 parent d56d35d commit 8d2662a

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

xenserver/etc_init.d_openvswitch

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,14 @@ function remove_all_dp {
181181
}
182182

183183
function insert_modules_if_required {
184+
if test -e /sys/module/bridge; then
185+
bridges=`echo /sys/class/net/*/bridge | sed 's,/sys/class/net/,,g;s,/bridge,,g'`
186+
if test "$bridges" != "*"; then
187+
log_warning_msg "not removing bridge module because bridges exist ($bridges)"
188+
else
189+
action "removing bridge module" rmmod bridge
190+
fi
191+
fi
184192
if ! lsmod | grep -q "openvswitch_mod"; then
185193
action "Inserting llc module" modprobe llc
186194
action "Inserting openvswitch module" modprobe openvswitch_mod

0 commit comments

Comments
 (0)