summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--zfcpconf.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/zfcpconf.sh b/zfcpconf.sh
index dca117e..8dc05ad 100644
--- a/zfcpconf.sh
+++ b/zfcpconf.sh
@@ -2,10 +2,12 @@
# config file syntax:
# deviceno WWPN FCPLUN
+# deviceno # allowed when auto LUN scan is enabled and port is in NPIV mode
#
# Example:
# 0.0.4000 0x5005076300C213e9 0x5022000000000000
# 0.0.4001 0x5005076300c213e9 0x5023000000000000
+# 0.0.5000
#
#
# manual setup:
@@ -42,6 +44,17 @@ if [ -f "$CONFIG" ]; then
*)
[ -z "$line" ] && continue
set $line
+ if [ $# -eq 1 ]; then
+ DEVICE=${1##*0x}
+ if [ `cat /sys/module/zfcp/parameters/allow_lun_scan` = "Y" ]; then
+ set_online ${DEVICE}
+ grep -q NPIV /sys/bus/ccw/devices/${DEVICE}/host*/fc_host/host*/port_type || \
+ echo "Error: Only device ID (${DEVICE}) given, but port not in NPIV mode"
+ else
+ echo "Error: Only device ID (${DEVICE}) given, but LUN scan is disabled for the zfcp module"
+ fi
+ continue
+ fi
if [ $# -eq 5 ]; then
DEVICE=$1
SCSIID=$2