lszfcp: also mark FCP devices (hosts) that are not available

Also mark FCP devices with CHPID that is logically varied off,
e.g. after running "chchp -v 0 60".
Such FCP devices can be online, not failed, and are not defunct,
so the other existing markers do not appear.

Shows potential issues with FCP devices at one glance.

Examples:

$ lszfcp -He
0.0.1900 host0 NotAvailable

$ lszfcp -HeV
/sys/devices/css0/0.0.010d/0.0.1900 NotAvailable
/sys/class/fc_host/host0
/sys/class/scsi_host/host0

Signed-off-by: Steffen Maier <maier@linux.ibm.com>
Complements: 4036e80b26 ("lszfcp: add new output marker for non-good FCP devices (hosts)")
Reviewed-by: Jens Remus <jremus@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Steffen Maier
2019-02-21 18:38:45 +01:00
committed by Jan Höppner
parent 05a0f8e0eb
commit be7b854969

View File

@@ -202,6 +202,7 @@ $(readlink -e $HOST_PATH)/-"
[ $ADAPTER != ${PAR_BUSID:-$ADAPTER} ] && continue
read ONLINE < $ADAPTER_PATH/online
read AVAILABILITY < $ADAPTER_PATH/availability
[ -r $ADAPTER_PATH/failed ] && read FAILED < $ADAPTER_PATH/failed
DEFUNCT=${ADAPTER_PATH%/*} # strip devbusid
DEFUNCT=${DEFUNCT##*/} # basename
@@ -213,6 +214,8 @@ $(readlink -e $HOST_PATH)/-"
HOSTMARKER=" offline"
elif [ "$FAILED" = "1" ]; then
HOSTMARKER=" failed"
elif [ "$AVAILABILITY" != "good" ]; then
HOSTMARKER=" NotAvailable"
fi
fi
if [ $VERBOSITY -eq 0 ]; then