From 06e41baf2ae176050cfe71a7824a17cc95cf388c Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Fri, 26 Mar 2010 13:24:06 -0700 Subject: [PATCH] xenserver: Disable brcompatd except on XenServer 5.5.0 The compat layer is now unused in the vswitch branch of XenServer. Based on change originally by Ian Campbell, cherry-picked from "xs5.7" branch. The original change was not conditional on the XenServer version. --- xenserver/etc_init.d_openvswitch | 19 +++++++++++++------ ...are_openvswitch_scripts_sysconfig.template | 8 ++++++-- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/xenserver/etc_init.d_openvswitch b/xenserver/etc_init.d_openvswitch index fe8360fe..dfc346fa 100755 --- a/xenserver/etc_init.d_openvswitch +++ b/xenserver/etc_init.d_openvswitch @@ -21,11 +21,19 @@ . /etc/init.d/functions +. /etc/xensource-inventory test -e /etc/sysconfig/openvswitch && . /etc/sysconfig/openvswitch # General config variables in /etc/sysconfig/openvswitch -: ${ENABLE_BRCOMPAT:=y} -: ${ENABLE_FAKE_PROC_NET:=y} +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 : ${ENABLE_MONITOR:=y} : ${FORCE_COREFILES:=y} @@ -115,7 +123,7 @@ function insert_modules_if_required { action "Inserting llc module" modprobe llc action "Inserting openvswitch module" modprobe openvswitch_mod fi - if [ -n "$BRCOMPATD_PIDFILE" ] && ! lsmod | grep -q "brcompat_mod"; then + if [ "$ENABLE_BRCOMPATD" = "y" ] && [ -n "$BRCOMPATD_PIDFILE" ] && ! lsmod | grep -q "brcompat_mod"; then action "Inserting brcompat module" modprobe brcompat_mod fi if [ -f "/lib/modules/`uname -r`/kernel/net/openvswitch/ip_gre_mod.ko" ] && ! lsmod | grep -q "ip_gre_mod"; then @@ -338,10 +346,9 @@ EOF } function set_system_uuid { - system_uuid=$(. /etc/xensource-inventory && echo $INSTALLATION_UUID) - if test -n "$system_uuid"; then + if test -n "$INSTALLATION_UUID"; then action "Configuring Open vSwitch system UUID" true - $vsctl --no-wait set Open_vSwitch . external-ids:system-uuid="$system_uuid" + $vsctl --no-wait set Open_vSwitch . external-ids:system-uuid="$INSTALLATION_UUID" else action "Configuring Open vSwitch system UUID" false fi diff --git a/xenserver/usr_share_openvswitch_scripts_sysconfig.template b/xenserver/usr_share_openvswitch_scripts_sysconfig.template index 9bd51bc2..c639df81 100644 --- a/xenserver/usr_share_openvswitch_scripts_sysconfig.template +++ b/xenserver/usr_share_openvswitch_scripts_sysconfig.template @@ -9,13 +9,17 @@ # ENABLE_BRCOMPAT: If 'y' than emulate linux bridging interfaces # using the brcompat kernel module and ovs-brcompatd daemon -# ENABLE_BRCOMPAT=y +# This is required and enabled by default for XenServer 5.5.0, +# and not required and not enabled by default for later versions. +# ENABLE_BRCOMPAT=? # ENABLE_FAKE_PROC_NET: If 'y' then emulate linux bonding and vlan # files in /proc as if the bonding and vlan demultiplexing done in # ovs-vswitchd were being implemented using existing Linux mechanisms. # This is useful in some cases when replacing existing solutions. -# ENABLE_FAKE_PROC_NET=y +# This is required and enabled by default for XenServer 5.5.0, +# and not required and not enabled by default for later versions. +# ENABLE_FAKE_PROC_NET=? # ENABLE_MONITOR: If 'y' then monitor daemon processes and restart them # if they die due to an error signal. -- 2.30.2