- Update to Xen 4.4.0 FCS
- bnc#865682 - Local attach support for PHY backends using scripts local_attach_support_for_phy.patch - bnc#798770 - Improve multipath support for npiv devices block-npiv block-npiv-common.sh - honor global keymap= option in libxl libxl.honor-more-top-level-vfb-options.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=303
This commit is contained in:
committed by
Git OBS Bridge
parent
831e1fde19
commit
a785b8c089
94
block-npiv
94
block-npiv
@@ -13,48 +13,52 @@ case "$command" in
|
||||
add)
|
||||
# Params is one big arg, with fields separated by hyphens:
|
||||
# single path:
|
||||
# FABRIC-VPWWPN-VPWWNN-TGTWWPN-LUN#
|
||||
# VPWWPN-TGTWWPN-LUN#
|
||||
# multipath:
|
||||
# {FABRIC1.FABRIC2}-{VPWWPN1.VPWWPN2.VPWWPN3}-VPWWNN-TGTWWPN-LUN#
|
||||
# arg 2 - Fabric Name
|
||||
# arg 3 - VPORT's WWPN
|
||||
# arg 4 - VPORT's WWNN
|
||||
# arg 5 - Target's WWPN
|
||||
# arg 6 - LUN # on Target
|
||||
# {VPWWPN1.VPWWPN2....VPWWPNx}-{TGTWWPN1.TGTWWPN2....TGTWWPNx}-LUN#
|
||||
# arg 1 - VPORT's WWPN
|
||||
# arg 2 - Target's WWPN
|
||||
# arg 3 - LUN # on Target
|
||||
# no wwn contains a leading 0x - it is a 16 character hex value
|
||||
# You may want to optionally pick a specific adapter ?
|
||||
par=`xenstore-read $XENBUS_PATH/params` || true
|
||||
#par=$2
|
||||
NPIVARGS=$par;
|
||||
LUN=${NPIVARGS##*-*-*-*-}; NPIVARGS=${NPIVARGS%-*}
|
||||
if test $LUN = $NPIVARGS ; then exit 1; fi
|
||||
TGTWWPN=${NPIVARGS##*-*-*-}; NPIVARGS=${NPIVARGS%-*}
|
||||
if test $TGTWWPN = $NPIVARGS ; then exit 1; fi
|
||||
VPORTWWNN=${NPIVARGS##*-*-}; NPIVARGS=${NPIVARGS%-*}
|
||||
if test $VPORTWWNN = $NPIVARGS ; then exit 1; fi
|
||||
VPORTWWPNS=${NPIVARGS##*-}; NPIVARGS=${NPIVARGS%-*}
|
||||
if test $VPORTWWPNS = $NPIVARGS ; then exit 1; fi
|
||||
FABRICNMS=$NPIVARGS
|
||||
NPIVARGS=(${par//-/ })
|
||||
wc=${#NPIVARGS[@]}
|
||||
if [ $wc -eq 5 ]; then
|
||||
# support old syntax
|
||||
# FABRIC-VPWWPN-VPWWNN-TGTWWPN-LUN
|
||||
VPORTWWPNS=${NPIVARGS[1]}
|
||||
VPORTWWNNS=${NPIVARGS[2]}
|
||||
TGTWWPNS=${NPIVARGS[3]}
|
||||
LUN=${NPIVARGS[4]}
|
||||
elif [ $wc -eq 3 ]; then
|
||||
# new syntax
|
||||
VPORTWWPNS=${NPIVARGS[0]}
|
||||
TGTWWPNS=${NPIVARGS[1]}
|
||||
LUN=${NPIVARGS[2]}
|
||||
else
|
||||
# wrong syntax
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Ensure we compare everything using lower-case hex characters
|
||||
TGTWWPN=`echo $TGTWWPN | tr A-Z a-z`
|
||||
TGTWWPNS=`echo $TGTWWPNS | tr A-Z a-z |sed 's/[{.}]/ /g'`
|
||||
VPORTWWPNS=`echo $VPORTWWPNS | tr A-Z a-z |sed 's/[{.}]/ /g'`
|
||||
VPORTWWNN=`echo $VPORTWWNN | tr A-Z a-z`
|
||||
FABRICNMS=`echo $FABRICNMS | tr A-Z a-z |sed 's/[{.}]/ /g'`
|
||||
|
||||
# Only one VPWWNN is supported
|
||||
VPORTWWNN=`echo $VPORTWWNNS | tr A-Z a-z | sed -e 's/\..*//g' -e 's/{//'`
|
||||
|
||||
claim_lock "npiv"
|
||||
paths=0
|
||||
for FABRICNM in $FABRICNMS; do
|
||||
for VPORTWWPN in $VPORTWWPNS; do
|
||||
find_vhost $VPORTWWPN $FABRICNM
|
||||
if test -z "$vhost" ; then
|
||||
create_vport $FABRICNM $VPORTWWPN $VPORTWWNN
|
||||
if [ $? -ne 0 ] ; then exit 2; fi
|
||||
sleep 8
|
||||
find_vhost $VPORTWWPN $FABRICNM
|
||||
if test -z "$vhost" ; then exit 3; fi
|
||||
fi
|
||||
for VPORTWWPN in $VPORTWWPNS; do
|
||||
find_vhost $VPORTWWPN
|
||||
if test -z "$vhost" ; then
|
||||
create_vport $VPORTWWPN $VPORTWWNN
|
||||
if [ $? -ne 0 ] ; then exit 2; fi
|
||||
sleep 8
|
||||
find_vhost $VPORTWWPN
|
||||
if test -z "$vhost" ; then exit 3; fi
|
||||
fi
|
||||
for TGTWWPN in $TGTWWPNS; do
|
||||
find_sdev $vhost $TGTWWPN $LUN
|
||||
if test -z "$dev"; then
|
||||
echo "- - -" > /sys/class/scsi_host/$vhost/scan
|
||||
@@ -95,18 +99,22 @@ case "$command" in
|
||||
# terminate the entire vport (all luns)
|
||||
if test $multipath = 1; then
|
||||
par=`xenstore-read $XENBUS_PATH/params` || true
|
||||
NPIVARGS=$par;
|
||||
FABRICNMS=${NPIVARGS%%-*}; NPIVARGS=${NPIVARGS#*-}
|
||||
VPORTWWPNS=${NPIVARGS%%-*}
|
||||
NPIVARGS=(${par//-/ })
|
||||
wc=${#NPIVARGS[@]}
|
||||
if [ $wc -eq 5 ]; then
|
||||
# old syntax
|
||||
# FABRIC-VPWWPN-VPWWNN-TGTWWPN-LUN
|
||||
VPORTWWPNS=${NPIVARGS[1]}
|
||||
elif [ $wc -eq 3 ]; then
|
||||
# new syntax
|
||||
VPORTWWPNS=${NPIVARGS[0]}
|
||||
fi
|
||||
VPORTWWPNS=`echo $VPORTWWPNS | tr A-Z a-z |sed 's/[{.}]/ /g'`
|
||||
FABRICNMS=`echo $FABRICNMS | tr A-Z a-z |sed 's/[{.}]/ /g'`
|
||||
for FABRICNM in $FABRICNMS; do
|
||||
for VPORTWWPN in $VPORTWWPNS; do
|
||||
find_vhost $VPORTWWPN $FABRICNM
|
||||
if test -z "$vhost" ; then exit 5; fi
|
||||
flush_nodes_on_vhost $vhost
|
||||
delete_vhost $vhost
|
||||
done
|
||||
for VPORTWWPN in $VPORTWWPNS; do
|
||||
find_vhost $VPORTWWPN
|
||||
if test -z "$vhost" ; then exit 5; fi
|
||||
flush_nodes_on_vhost $vhost
|
||||
delete_vhost $vhost
|
||||
done
|
||||
else
|
||||
dev=$node; dev=${dev#/dev/}
|
||||
|
Reference in New Issue
Block a user