In fcoeplumb script, remove "create", "delete" and "reset" commands.
Signed-off-by: Lucy Liu <[email protected]> --- fcoeplumb.in | 89 +++++++--------------------------------------------------- 1 files changed, 10 insertions(+), 79 deletions(-) diff --git a/fcoeplumb.in b/fcoeplumb.in index c916f35..658bd9d 100755 --- a/fcoeplumb.in +++ b/fcoeplumb.in @@ -22,10 +22,8 @@ cmdname=`basename $0` usage() { echo usage: $cmdname \ - '[--fcoeif <ethX> --reset | --create | --destroy]' \ '[--debug] [--syslog]' \ - '[--netif <ethX> --qos-disable |' \ - '--qos-enable <pri>[,<pri>]...]' >&2 + '[<ethX> --qos-disable | --qos-enable <pri>[,<pri>]...]' >&2 exit 1 } @@ -51,8 +49,6 @@ sbind...@sbindir@ sysconfd...@sysconfdir@ # make sure there's a sane path to find basic commands and system tools (tc) PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin -FCOEADM=${sbindir}/fcoeadm # command to create/destroy FCoE instances -CONFIG_DIR=${sysconfdir}/fcoe LOGGER= DEBUG_LOGGING= @@ -194,36 +190,6 @@ replace_skbedit_filter() action skbedit queue_mapping $queue } -remove_fcoe_interface() -{ - ifname=$1 - - STATUS=`$FCOEADM -i $ifname 2>&1 | \ - awk '/Symbolic Name:/ && /'$ifname'$/{print $6}'` - if [ "$STATUS" == "$ifname" ]; then - [ ${DEBUG_LOGGING} ] && $LOGGER "$FCOEADM -d $ifname" - $FCOEADM -d $ifname - else - [ ${DEBUG_LOGGING} ] && $LOGGER \ - "FCoE interface $ifname doesn't exist" - fi -} - -create_fcoe_interface() -{ - ifname=$1 - - STATUS=`$FCOEADM -i $ifname 2>&1 | \ - awk '/Symbolic Name:/ && /'$ifname'$/{print $6}'` - if [ -z "$STATUS" ]; then - [ ${DEBUG_LOGGING} ] && $LOGGER "$FCOEADM -c $ifname" - $FCOEADM -c $ifname - else - [ ${DEBUG_LOGGING} ] && $LOGGER \ - "FCoE interface $ifname already created" - fi -} - config_logging() { if [ $DEBUG_LOGGING ] ; then @@ -241,48 +207,20 @@ config_logging() [ ${DEBUG_LOGGING} ] && $LOGGER "fcoeplumb arguments: ($*)" +net_ifname=$1 +shift + while [ "$#" -ge 1 ] do case "$1" in - --fcoeif) - shift - fcoe_ifname=$1 + --qos-enable) + [ "$#" -lt 2 ] && usage + qos_list=$2 shift - case "$1" in - --reset | -r) - cmd=reset - ;; - --create | -c) - cmd=create - ;; - --destroy | -d) - cmd=destroy - ;; - *) - echo "$cmdname: unknown fcoe parameter '$1'" >&2 - usage - ;; - esac ;; - --netif) - shift - net_ifname=$1 - shift - case "$1" in - --qos-enable) - [ "$#" -lt 2 ] && usage - qos_list=$2 - shift - ;; - --qos-disable) - [[ "$2" =~ ^[0-9]+$ ]] && shift - qos_list="disable" - ;; - *) - echo "$cmdname: unknown qos parameter '$1'" >&2 - usage - ;; - esac + --qos-disable) + [[ "$2" =~ ^[0-9]+$ ]] && shift + qos_list="disable" ;; --debug) DEBUG_LOGGING=1 @@ -306,13 +244,6 @@ done fcoe_filter_id=`get_filter_id $net_ifname $FCOE_FILTER_KEY` fip_filter_id=`get_filter_id $net_ifname $FIP_FILTER_KEY` -if [ "$cmd" == "destroy" ]; then - remove_fcoe_interface $fcoe_ifname - -elif [ "$cmd" == "create" ]; then - create_fcoe_interface $fcoe_ifname -fi - if [ "$qos_list" == "disable" ]; then # Remove the FCoE filters find_skbedit_filter $net_ifname $FCOE_ETHERTYPE $fcoe_filter_id -- Signature: Lucy Liu <[email protected]> _______________________________________________ devel mailing list [email protected] http://www.open-fcoe.org/mailman/listinfo/devel
