From be7b854969eb3047c4eeccc852a18530bf782e1b Mon Sep 17 00:00:00 2001 From: Steffen Maier Date: Thu, 21 Feb 2019 18:38:45 +0100 Subject: [PATCH] lszfcp: also mark FCP devices (hosts) that are not available MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Complements: 4036e80b265d ("lszfcp: add new output marker for non-good FCP devices (hosts)") Reviewed-by: Jens Remus Signed-off-by: Jan Höppner --- zconf/lszfcp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zconf/lszfcp b/zconf/lszfcp index df7d5d4c..4685c397 100755 --- a/zconf/lszfcp +++ b/zconf/lszfcp @@ -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