[ovs-dev] [suse 5/7] xenserver: Don't require /etc/xensource/network.conf if not on XenServer.

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


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

On XenServer systems, the "network mode" (that is, whether the network
uses OpenvSwitch or the Linux bridge) is stored in
/etc/xensource/network.conf.  On other systems, we can't expect it to be
there.  This changes the init script to tolerate its absence, treating that
as meaning that Open vSwitch should be used (otherwise, why did the admin
install it?).

NETWORK_MODE can always be overridden in /etc/sysconfig/openvswitch anyway.

Signed-off-by: Patrick Mullaney <pm.mullaney at gmail.com>
[changed back to read /etc/xensource/network.conf if present]
Signed-off-by: Ben Pfaff <blp at nicira.com>
---
 xenserver/etc_init.d_openvswitch |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/xenserver/etc_init.d_openvswitch b/xenserver/etc_init.d_openvswitch
index e4f9964..72d7d57 100755
--- a/xenserver/etc_init.d_openvswitch
+++ b/xenserver/etc_init.d_openvswitch
@@ -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)
-- 
1.7.1





More information about the dev mailing list