Skip to content

Commit

Permalink
xenserver: Remove support for XenServer versions older than 5.6 FP1.
Browse files Browse the repository at this point in the history
Commit 404c169 breaks compatibility with
XenServers older than 5.6 FP1.  This commit removes the last vestiges of
support for those older XenServer versions.

Signed-off-by: Justin Pettit <[email protected]>
  • Loading branch information
Justin Pettit authored and Andrew Evans committed Feb 11, 2011
1 parent 54f16a1 commit 34edecc
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 304 deletions.
2 changes: 0 additions & 2 deletions tests/interface-reconfigure.at
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,6 @@ Applying changes to /etc/sysconfig/network-scripts/ifcfg-xapi3 configuration
set Bridge xenbr3 other-config:hwaddr="00:15:17:a0:29:81"
set Bridge xenbr3 fail_mode=standalone
br-set-external-id xenbr3 xs-network-uuids 2902ae1b-8013-897a-b697-0b200ea3aaa5;db7bdc03-074d-42ae-fc73-9b06de1d57f6
--if-exists del-br xapi3
--may-exist add-br xapi3 xenbr3 123
br-set-external-id xapi3 xs-network-uuids 2902ae1b-8013-897a-b697-0b200ea3aaa5;db7bdc03-074d-42ae-fc73-9b06de1d57f6
set Interface xapi3 MAC="00:15:17:a0:29:81"
Expand Down Expand Up @@ -909,7 +908,6 @@ Applying changes to /etc/sysconfig/network-scripts/ifcfg-xapi2 configuration
set Bridge xapi1 other-config:hwaddr="00:22:19:22:4b:af"
set Bridge xapi1 fail_mode=standalone
br-set-external-id xapi1 xs-network-uuids 45cbbb43-113d-a712-3231-c6463f253cef;99be2da4-6c33-6f8e-49ea-3bc592fe3c85
--if-exists del-br xapi2
--may-exist add-br xapi2 xapi1 4
br-set-external-id xapi2 xs-network-uuids 45cbbb43-113d-a712-3231-c6463f253cef;99be2da4-6c33-6f8e-49ea-3bc592fe3c85
set Interface xapi2 MAC="00:22:19:22:4b:af"
Expand Down
5 changes: 0 additions & 5 deletions xenserver/README
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@ files are:
Daemon to monitor the external_ids columns of the Bridge and
Interface OVSDB tables.

usr_share_openvswitch_scripts_refresh-xs-network-uuids

Script to refresh Bridge table external-ids:xs-network-uuids
values, which can get out-of-sync following a pool join.

usr_share_openvswitch_scripts_sysconfig.template

Template for Open vSwitch's /etc/sysconfig/openvswitch
Expand Down
1 change: 0 additions & 1 deletion xenserver/automake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,5 @@ EXTRA_DIST += \
xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py \
xenserver/usr_sbin_xen-bugtool \
xenserver/usr_share_openvswitch_scripts_ovs-external-ids \
xenserver/usr_share_openvswitch_scripts_refresh-xs-network-uuids \
xenserver/usr_share_openvswitch_scripts_sysconfig.template \
xenserver/uuid.py
69 changes: 2 additions & 67 deletions xenserver/etc_init.d_openvswitch
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,6 @@ case ${NETWORK_MODE:=openvswitch} in
;;
esac

# General config variables in /etc/sysconfig/openvswitch
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}
fi
: ${ENABLE_MONITOR:=y}
: ${FORCE_COREFILES:=y}

Expand Down Expand Up @@ -124,36 +109,15 @@ fi
: ${VSWITCHD_VALGRIND_LOG:=}
: ${VSWITCHD_VALGRIND_OPT:=}

# Config variables specific to ovs-brcompatd
: ${BRCOMPATD_PIDFILE:=/var/run/openvswitch/ovs-brcompatd.pid}
: ${BRCOMPATD_RUN_DIR:=/var/xen/openvswitch}
: ${BRCOMPATD_PRIORITY:=-10}
: ${BRCOMPATD_LOGFILE:=/var/log/openvswitch/ovs-brcompatd.log}
: ${BRCOMPATD_FILE_LOGLEVEL:=INFO}
: ${BRCOMPATD_SYSLOG_LOGLEVEL:=ERR}
: ${BRCOMPATD_MEMLEAK_LOGFILE:=}
: ${BRCOMPATD_STRACE_LOG:=}
: ${BRCOMPATD_STRACE_OPT:=}
: ${BRCOMPATD_VALGRIND_LOG:=}
: ${BRCOMPATD_VALGRIND_OPT:=}

# Full paths to executables & modules
ovsdb_server="/usr/sbin/ovsdb-server"
ovsdb_tool="/usr/bin/ovsdb-tool"
vswitchd="/usr/sbin/ovs-vswitchd"
brcompatd="/usr/sbin/ovs-brcompatd"
dpctl="/usr/bin/ovs-dpctl"
appctl="/usr/bin/ovs-appctl"
ofctl="/usr/bin/ovs-ofctl"
vsctl="/usr/bin/ovs-vsctl"

if [ "$ENABLE_FAKE_PROC_NET" = "y" ]; then
if [ "$ENABLE_BRCOMPAT" != "y" ]; then
warning "FAKE_PROC_NET required BRCOMPAT which was disabled. Force enabling."
ENABLE_BRCOMPAT="y"
fi
fi

if test "$ENABLE_MONITOR" = "y"; then
monitor_opt="--monitor"
else
Expand Down Expand Up @@ -189,15 +153,9 @@ function insert_modules_if_required {
action "Inserting llc module" modprobe llc
action "Inserting openvswitch module" modprobe openvswitch_mod
fi
if [ "$ENABLE_BRCOMPAT" = "y" ] && [ -n "$BRCOMPATD_PIDFILE" ] && ! lsmod | grep -q "brcompat_mod"; then
action "Inserting brcompat module" modprobe brcompat_mod
fi
}

function remove_modules {
if lsmod | grep -q "brcompat_mod"; then
action "Removing brcompat module" rmmod brcompat_mod.ko
fi
if lsmod | grep -q "openvswitch_mod"; then
action "Removing openvswitch module" rmmod openvswitch_mod.ko
fi
Expand Down Expand Up @@ -280,26 +238,14 @@ function start_ovsdb_server {
}

function start_vswitchd {
local fake_proc_net_opt=
if [ "$ENABLE_FAKE_PROC_NET" = "y" ]; then
fake_proc_net_opt="--fake-proc-net"
fi

local mlockall_opt=
if [ "$VSWITCHD_MLOCKALL" != "no" ]; then
mlockall_opt="--mlockall"
fi

start_daemon VSWITCHD "$vswitchd" $fake_proc_net_opt $mlockall_opt \
"$VSWITCHD_OVSDB_SERVER"
start_daemon VSWITCHD "$vswitchd" $mlockall_opt "$VSWITCHD_OVSDB_SERVER"
}

function start_brcompatd {
start_daemon BRCOMPATD "$brcompatd" \
--appctl-command="$appctl --target=/var/run/openvswitch/ovs-vswitchd.\`cat $VSWITCHD_PIDFILE\`.ctl %s" \
"$VSWITCHD_OVSDB_SERVER"
}

function stop_daemon {
local DAEMON=$1
local BINARY=$2
Expand Down Expand Up @@ -414,9 +360,6 @@ function start {
set_system_ids

start_vswitchd
if [ "${ENABLE_BRCOMPAT}" = "y" ] ; then
start_brcompatd
fi

if [ -f /etc/xensource-inventory ]; then
# Start daemon to monitor external ids
Expand All @@ -429,7 +372,6 @@ function start {
}

function stop {
stop_daemon BRCOMPATD "$brcompatd"
stop_daemon VSWITCHD "$vswitchd"
stop_daemon OVSDB_SERVER "$ovsdb_server"
if [ -e /var/run/openvswitch/ovs-external-ids.pid ]; then
Expand Down Expand Up @@ -510,20 +452,13 @@ case "$1" in
shift
strace -p $(cat "$VSWITCHD_PIDFILE") "$@"
;;
strace-brcompatd)
shift
strace -p $(cat "$BRCOMPATD_PIDFILE") "$@"
;;
status)
status -p "$OVSDB_SERVER_PIDFILE" ovsdb-server &&
status -p "$VSWITCHD_PIDFILE" ovs-vswitchd &&
(test "$ENABLE_BRCOMPAT" != "y" ||
status -p "$BRCOMPATD_PIDFILE" ovs-brcompatd)
status -p "$VSWITCHD_PIDFILE" ovs-vswitchd
;;
version)
/usr/sbin/ovsdb-server -V
/usr/sbin/ovs-vswitchd -V
/usr/sbin/ovs-brcompatd -V
;;
force-reload-kmod)
force_reload_kmod
Expand Down
5 changes: 1 addition & 4 deletions xenserver/etc_logrotate.d_openvswitch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2009, 2010 Nicira Networks, Inc.
# Copyright (C) 2009, 2010, 2011 Nicira Networks, Inc.
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
Expand All @@ -16,8 +16,5 @@
if [ -e /var/run/openvswitch/ovsdb-server.pid ]; then
/usr/bin/ovs-appctl -t ovsdb-server vlog/reopen
fi
if [ -e /var/run/openvswitch/ovs-brcompatd.pid ]; then
/usr/bin/ovs-appctl -t ovs-brcompatd vlog/reopen
fi
endscript
}
4 changes: 2 additions & 2 deletions xenserver/etc_profile.d_openvswitch.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2009, 2010 Nicira Networks, Inc.
# Copyright (C) 2009, 2010, 2011 Nicira Networks, Inc.
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
Expand Down Expand Up @@ -42,7 +42,7 @@ function monitorlogs {
done
grep="$grep'"
fi
cmd="tail -F /var/log/messages /var/log/openvswitch/ovs-vswitchd.log /var/log/openvswitch/ovs-brcompatd.log /var/log/openvswitch/ovsdb-server /var/log/xensource.log $grep | tee /var/log/monitorlogs.out"
cmd="tail -F /var/log/messages /var/log/openvswitch/ovs-vswitchd.log /var/log/openvswitch/ovsdb-server /var/log/xensource.log $grep | tee /var/log/monitorlogs.out"
printf "cmd: $cmd\n"
eval "$cmd"
}
5 changes: 1 addition & 4 deletions xenserver/etc_xensource_scripts_vif
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,7 @@ remove_from_bridge()
# Nothing to do
;;
openvswitch)
# If ovs-brcompatd is running, it might already have deleted the
# port. Use --if-exists to suppress the error that would otherwise
# arise in that case.
$vsctl --timeout=30 -- --if-exists del-port $dev
$vsctl --timeout=30 -- del-port $dev
;;
esac
}
Expand Down
95 changes: 5 additions & 90 deletions xenserver/openvswitch-xen.spec
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ install -m 755 xenserver/etc_xensource_scripts_vif \
$RPM_BUILD_ROOT/usr/share/openvswitch/scripts/vif
install -m 755 xenserver/usr_share_openvswitch_scripts_ovs-external-ids \
$RPM_BUILD_ROOT/usr/share/openvswitch/scripts/ovs-external-ids
install -m 755 xenserver/usr_share_openvswitch_scripts_refresh-xs-network-uuids \
$RPM_BUILD_ROOT/usr/share/openvswitch/scripts/refresh-xs-network-uuids
install -m 755 xenserver/usr_sbin_xen-bugtool \
$RPM_BUILD_ROOT/usr/share/openvswitch/scripts/xen-bugtool
install -m 755 xenserver/usr_share_openvswitch_scripts_sysconfig.template \
Expand Down Expand Up @@ -111,77 +109,6 @@ install -d -m 755 $RPM_BUILD_ROOT/var/lib/openvswitch
rm -rf $RPM_BUILD_ROOT

%post
if [ ! -f /etc/xensource-inventory ]; then
printf "XenSource inventory not present in /etc/xensource-inventory"
exit 1
fi
. /etc/xensource-inventory

if [ "$1" = "1" ]; then
if md5sum -c --status <<EOF
ca141d60061dcfdade73e75abc6529b5 /usr/sbin/brctl
b8e9835862ef1a9cec2a3f477d26c989 /etc/xensource/scripts/vif
51970ad613a3996d5997e18e44db47da /opt/xensource/libexec/interface-reconfigure
5654c8c36699fcc8744ca9cd5b855414 /usr/sbin/xen-bugtool
EOF
then
printf "\nVerified host scripts from XenServer 5.5.0.\n\n"
elif md5sum -c --status <<EOF
ca141d60061dcfdade73e75abc6529b5 /usr/sbin/brctl
b8e9835862ef1a9cec2a3f477d26c989 /etc/xensource/scripts/vif
51970ad613a3996d5997e18e44db47da /opt/xensource/libexec/interface-reconfigure
f6519085c2fc5f7bc4eccc294ed62000 /usr/sbin/xen-bugtool
EOF
then
printf "\nVerified host scripts from XenServer 5.5.0-24648p (Update 1)\n"
printf "or 5.5.0-25727p (Update 2).\n\n"
elif md5sum -c --status <<EOF
ca141d60061dcfdade73e75abc6529b5 /usr/sbin/brctl
02cf136237ed85fcbcc1efc15ce0591c /opt/xensource/libexec/interface-reconfigure
3a192ee70ebf2153c90051b3af95f331 /opt/xensource/libexec/InterfaceReconfigureBridge.py
f71cadf1464caefa7943de0ab47fdd8a /opt/xensource/libexec/InterfaceReconfigure.py
d70f08f235fb1bfd49a0580e440f15a0 /opt/xensource/libexec/InterfaceReconfigureVswitch.py
f5c85ca825b1e6f5a0845530981cd836 /etc/xensource/scripts/vif
facb851606f82ca2bcc760a4d91bbe33 /usr/sbin/xen-bugtool
EOF
then
printf "\nVerified host scripts from XenServer 5.5.900-29381p.\n\n"
else
cat <<EOF

The original XenServer scripts replaced by this package are not those
of any supported version of XenServer. This could lead to unexpected
behavior of your server. Unless you are sure you know what you are
doing, it is highly recommended that you remove this package
immediately after the install completes, which will restore the
XenServer scripts that you were previously using.

EOF
fi
fi

# On XenServer 5.5.0, we need refresh-xs-network-uuids to run whenever
# XAPI starts or restarts. (On XenServer 5.6.0, XAPI calls the
# "update" method of the vswitch-cfg-update plugin whenever it starts
# or restarts, so this is no longer necessary.)
if test "$PRODUCT_VERSION" = "5.5.0"; then
RNU=/usr/share/openvswitch/scripts/refresh-xs-network-uuids
XSS=/opt/xensource/libexec/xapi-startup-script
if test -e $XSS && (test ! -L $XSS || test "`readlink $XSS`" != $RNU); then
echo "$XSS is already in use, refusing to overwrite"
exit 1
fi
rm -f $XSS
ln -s $RNU $XSS

# If /etc/xensource/network.conf doesn't exist (it was added in 5.6.0),
# then interface-reconfigure will be unhappy when we run it below.
if test ! -e /etc/xensource/network.conf; then
echo bridge > /etc/xensource/network.conf
fi
fi


if test ! -e /var/xapi/network.dbcache; then
if test "$1" = 1; then
printf "Creating xapi database cache... "
Expand Down Expand Up @@ -302,12 +229,6 @@ fi

%postun
if [ "$1" = "0" ]; then # $1 = 1 for upgrade
. /etc/xensource-inventory
if test "$PRODUCT_VERSION" = "5.5.0"; then
XSS=/opt/xensource/libexec/xapi-startup-script
rm -f $XSS
fi

rm -f /usr/lib/xsconsole/plugins-base/XSFeatureVSwitch.pyc \
/usr/lib/xsconsole/plugins-base/XSFeatureVSwitch.pyo

Expand Down Expand Up @@ -344,13 +265,8 @@ if [ "$1" = "0" ]; then # $1 = 1 for upgrade
rm -f /etc/openvswitch/vswitchd.cacert
rm -f /var/xapi/network.dbcache

if test "$PRODUCT_VERSION" != "5.5.0"; then
# Configure system to use bridge
echo bridge > /etc/xensource/network.conf
else
# Get rid of network.conf entirely, to make the system pristine.
rm -f /etc/xensource/network.conf
fi
# Configure system to use bridge
echo bridge > /etc/xensource/network.conf

printf "\nYou MUST reboot the server now to complete the change to\n"
printf "standard Xen networking. Attempts to modify networking on the\n"
Expand All @@ -367,7 +283,6 @@ fi
/etc/logrotate.d/openvswitch
/etc/profile.d/openvswitch.sh
/lib/modules/%{xen_version}/kernel/extra/openvswitch/openvswitch_mod.ko
/lib/modules/%{xen_version}/kernel/extra/openvswitch/brcompat_mod.ko
/usr/share/openvswitch/python/ovs/__init__.py
/usr/share/openvswitch/python/ovs/daemon.py
/usr/share/openvswitch/python/ovs/db/__init__.py
Expand All @@ -391,7 +306,6 @@ fi
/usr/share/openvswitch/python/ovs/util.py
/usr/share/openvswitch/python/uuid.py
/usr/share/openvswitch/scripts/ovs-external-ids
/usr/share/openvswitch/scripts/refresh-xs-network-uuids
/usr/share/openvswitch/scripts/interface-reconfigure
/usr/share/openvswitch/scripts/InterfaceReconfigure.py
/usr/share/openvswitch/scripts/InterfaceReconfigureBridge.py
Expand All @@ -401,7 +315,6 @@ fi
/usr/share/openvswitch/scripts/sysconfig.template
/usr/share/openvswitch/scripts/ovs-save
/usr/share/openvswitch/vswitch.ovsschema
/usr/sbin/ovs-brcompatd
/usr/sbin/ovs-vswitchd
/usr/sbin/ovsdb-server
/usr/bin/ovs-appctl
Expand All @@ -419,7 +332,6 @@ fi
/usr/share/man/man1/ovsdb-tool.1.gz
/usr/share/man/man5/ovs-vswitchd.conf.db.5.gz
/usr/share/man/man8/ovs-appctl.8.gz
/usr/share/man/man8/ovs-brcompatd.8.gz
/usr/share/man/man8/ovs-dpctl.8.gz
/usr/share/man/man8/ovs-ofctl.8.gz
/usr/share/man/man8/ovs-parse-leaks.8.gz
Expand All @@ -429,7 +341,10 @@ fi
/usr/share/man/man8/ovs-vsctl.8.gz
/usr/share/man/man8/ovs-vswitchd.8.gz
/var/lib/openvswitch
%exclude /lib/modules/%{xen_version}/kernel/extra/openvswitch/brcompat_mod.ko
%exclude /usr/lib/xsconsole/plugins-base/*.py[co]
%exclude /usr/sbin/ovs-brcompatd
%exclude /usr/share/man/man8/ovs-brcompatd.8.gz
%exclude /usr/share/openvswitch/scripts/*.py[co]
%exclude /usr/share/openvswitch/python/*.py[co]
%exclude /usr/share/openvswitch/python/ovs/*.py[co]
Expand Down
Loading

0 comments on commit 34edecc

Please sign in to comment.