. /etc/init.d/functions
+MANAGEMENT_INTERFACE=""
+if [ -f /etc/xensource-inventory ]; then
+ . /etc/xensource-inventory
+fi
+
test -e /etc/sysconfig/vswitch && . /etc/sysconfig/vswitch
VSWITCH_BASE="${VSWITCH_BASE:-/root/vswitch}"
VSWITCHD_CONF="${VSWITCHD_CONF:-/etc/vswitchd.conf}"
valgrind_opt="valgrind --log-file=$VALGRIND_LOG $VALGRIND_OPT"
daemonize_opt=""
fi
- #[ "$1" = "update-modules" ] || [ "$1" = "restart" ] || clear_old_bridge_ports
action "Starting vswitchd" nice -n "$VSWITCHD_PRIORITY" $strace_opt $valgrind_opt $VSWITCH_BASE/sbin/vswitchd -P"$VSWITCHD_PIDFILE" $daemonize_opt -vANY:CONSOLE:EMER $syslog_opt $logfile_level_opt $logfile_file_opt $leak_opt "$VSWITCHD_CONF"
- # Always attempt to force bridge interfaces up because otherwise
- # vswitch and XAPI interact badly on startup
sleep 2 # Give time for vswitch to get up and running.
- for dp in $(dp_list); do
+ # In Xen environments, always attempt to force the management
+ # bridge interface up because otherwise vswitch and XAPI interact
+ # badly on startup.
+ if [ -n "$MANAGEMENT_INTERFACE" ] && [ -e "/etc/sysconfig/network-scripts/ifcfg-$MANAGEMENT_INTERFACE" ]; then
+ action "Bringing up management interface: $MANAGEMENT_INTERFACE" ifup "$MANAGEMENT_INTERFACE"
+ fi
+ # When attempting to restart or update modules online, bring up
+ # all bridge interfaces since presumably they were in use before
+ # we went down.
+ for dp in $(dp_list); do
local intf=$(dp_intf $dp)
if [ -e "/etc/sysconfig/network-scripts/ifcfg-$intf" ]; then
- action "Bringing up datapath interface: $intf" ifup "$intf"
+ if [ "$1" == "update-modules" ]; then
+ action "Bringing up datapath interface: $intf" ifup "$intf"
+ fi
fi
done
}