X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=xenserver%2Fetc_init.d_openvswitch;h=6adb004646358051366fdca542b293aee713d080;hb=e05924baf0c757b579eef2b3743130ade4b1a93c;hp=31aa3fbc1252f21ee506476db8fd1ce1c246551c;hpb=5badabf575544be30ac671c3961c65911c3f2490;p=openvswitch diff --git a/xenserver/etc_init.d_openvswitch b/xenserver/etc_init.d_openvswitch index 31aa3fbc..6adb0046 100755 --- a/xenserver/etc_init.d_openvswitch +++ b/xenserver/etc_init.d_openvswitch @@ -20,8 +20,8 @@ # limitations under the License. ### BEGIN INIT INFO # Provides: openvswitch-switch -# Required-Start: $network $named $remote_fs $syslog -# Required-Stop: $remote_fs +# Required-Start: +# Required-Stop: # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Open vSwitch switch @@ -57,11 +57,13 @@ else } fi -. /etc/xensource-inventory +test -e /etc/xensource-inventory && . /etc/xensource-inventory test -e /etc/sysconfig/openvswitch && . /etc/sysconfig/openvswitch +if test -e /etc/xensource/network.conf; then + NETWORK_MODE=$(cat /etc/xensource/network.conf) +fi -NETWORK_MODE=$(cat /etc/xensource/network.conf) -case $NETWORK_MODE in +case ${NETWORK_MODE:=openvswitch} in vswitch|openvswitch) ;; bridge) @@ -74,14 +76,19 @@ case $NETWORK_MODE in esac # General config variables in /etc/sysconfig/openvswitch -if test "$PRODUCT_VERSION" = "5.5.0"; then - # XenServer 5.5.0 needs ovs-brcompatd and /proc/net simulation. +if [ -f /etc/xensource-inventory ]; then + if test "$PRODUCT_VERSION" = "5.5.0"; then + # XenServer 5.5.0 needs ovs-brcompatd and /proc/net simulation. + : ${ENABLE_BRCOMPAT:=y} + : ${ENABLE_FAKE_PROC_NET:=y} + else + # Later versions don't need them. + : ${ENABLE_BRCOMPAT:=n} + : ${ENABLE_FAKE_PROC_NET:=n} + fi +else : ${ENABLE_BRCOMPAT:=y} : ${ENABLE_FAKE_PROC_NET:=y} -else - # Later versions don't need them. - : ${ENABLE_BRCOMPAT:=n} - : ${ENABLE_FAKE_PROC_NET:=n} fi : ${ENABLE_MONITOR:=y} : ${FORCE_COREFILES:=y} @@ -174,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