From 81ec03fdac2dd9ccf5108d64cffef3f6e417a323 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 18 May 2009 15:32:20 -0700 Subject: [PATCH] xenserver: Remove now-unsupported commands from /etc/init.d/vswitch. The "unload" and "update-modules" commands for /etc/init.d/vswitch were based on the files in /etc/sysconfig/network-scripts. The current implementation of interface-reconfigure no longer updates those files, so these commands would no longer work reliably. Worse, they would work *sometimes* but not other times, so it's better not to offer them at all. It might make sense to reimplement these, if they are useful enough. --- xenserver/etc_init.d_vswitch | 81 ------------------------------------ 1 file changed, 81 deletions(-) diff --git a/xenserver/etc_init.d_vswitch b/xenserver/etc_init.d_vswitch index 5c05df7b..d5376902 100755 --- a/xenserver/etc_init.d_vswitch +++ b/xenserver/etc_init.d_vswitch @@ -78,61 +78,6 @@ function dp_list { "$dpctl" show | grep '^dp[0-9]\+:' | cut -d':' -f 1 } -function dp_intf { - local dp=$1 - # Currently port0 is hardcoded to be the local port. - "$dpctl" show $dp | grep 'port 0:' | cut -d' ' -f 3 -} - -function ifdown_dp_intf { - for dp in $(dp_list); do - local intf=$(dp_intf $dp) - if [ -e "/etc/sysconfig/network-scripts/ifcfg-$intf" ]; then - action "Bringing down datapath interface: $intf" ifdown "$intf" - fi - done -} - -function xen_mgmt_intf { - ( test -e /etc/xensource-inventory \ - && source /etc/xensource-inventory \ - && echo "$MANAGEMENT_INTERFACE" ) -} - -function xen_mgmt_pifdev { - ( test -e "/etc/sysconfig/network-scripts/ifcfg-$1" \ - && source "/etc/sysconfig/network-scripts/ifcfg-$1" \ - && echo "$PIFDEV" ) -} - -function xen_pifdev_hwaddr { - ( test -e "/etc/sysconfig/network-scripts/ifcfg-$1" \ - && source "/etc/sysconfig/network-scripts/ifcfg-$1" \ - && echo "$HWADDR" ) -} - -function allow_xen_mgmt_traffic { - local mgmt_intf=$(xen_mgmt_intf) - test -n "$mgmt_intf" || return - # TBD: This needs to be extended to deal with VLANs, etc. - local mgmt_pifdev=$(xen_mgmt_pifdev "$mgmt_intf") - test -n "$mgmt_pifdev" || return - local mgmt_hwaddr=$(xen_pifdev_hwaddr "$mgmt_pifdev") - test -n "$mgmt_hwaddr" || return - action "Inserting dl_addr $mgmt_hwaddr flows for mgmt intf" true - "$ofctl" add-flow "$mgmt_intf" dl_src="$mgmt_hwaddr",idle_timeout=0,priority=0,action=normal - "$ofctl" add-flow "$mgmt_intf" dl_dst="$mgmt_hwaddr",idle_timeout=0,priority=0,action=normal -} - -function ifup_dp_intf { - 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" - fi - done -} - function turn_on_corefiles { # This has global effect so should not normally be used... ulimit -c unlimited @@ -296,15 +241,6 @@ function start { start_vswitchd start_brcompatd reload_vswitchd # ensures ovs-vswitchd has fully read config file. - #allow_xen_mgmt_traffic # Seems to work okay without... -} - -function stop_unload { - stop_brcompatd - ifdown_dp_intf - remove_all_dp - stop_vswitchd - remove_modules } function stop { @@ -312,17 +248,6 @@ function stop { stop_vswitchd } -function restart_unload { - if restart_approval; then - stop_unload - insert_modules_if_required - start_vswitchd - reload_vswitchd - ifup_dp_intf - start_brcompatd - fi -} - function restart { if restart_approval; then stop @@ -354,12 +279,6 @@ case "$1" in shift strace -p $(cat "$BRCOMPATD_PIDFILE") "$@" ;; - unload) - stop_unload - ;; - update-modules) - restart_unload - ;; status) status -p ovs-vswitchd.pid ovs-vswitchd status -p ovs-brcompatd.pid ovs-brcompatd -- 2.30.2