xenserver: Don't openvswitch-xapi-update in bridge mode.
authorEthan Jackson <ethan@nicira.com>
Tue, 12 Apr 2011 01:33:06 +0000 (18:33 -0700)
committerEthan Jackson <ethan@nicira.com>
Tue, 12 Apr 2011 20:18:42 +0000 (13:18 -0700)
This commit causes the init scripts not to call the
openvswitch-cfg-update plugin when in bridge mode.

xenserver/etc_init.d_openvswitch-xapi-update

index 7b2efd1c8f88ea4785a7c5ddf802ce9cfef46809..14d2cc9bd78faf8555f683bce80c1c71bbfd8f91 100755 (executable)
@@ -39,6 +39,23 @@ function start {
         printf "openvswitch-xapi-update ERROR: XenSource inventory not present in /etc/xensource-inventory\n"
         exit 1
     fi
+
+    if test -e /etc/xensource/network.conf; then
+        NETWORK_MODE=$(cat /etc/xensource/network.conf)
+    fi
+
+    case ${NETWORK_MODE:=openvswitch} in
+        vswitch|openvswitch)
+            ;;
+        bridge)
+            exit 0
+            ;;
+        *)
+            echo "Open vSwitch disabled (/etc/xensource/network.conf is invalid)" >&2
+            exit 0
+            ;;
+    esac
+
     source /etc/xensource-inventory
     action "Updating configuration" do_host_call
 }