From 15cdf8ac5f93ace4c489333da81d2a077c771f9c Mon Sep 17 00:00:00 2001
From: Henrik Riomar <henrik.riomar@gmail.com>
Date: Sun, 28 Jan 2018 18:54:49 +0100
Subject: [PATCH] hotplug/Linux: iscsi block, handle lun-1

With tgtd lun-0 is the controller and lun-1 is the disk, check
for both 0 and 1 in the readlink call.

Reference:
 http://inqbus-hosting.de/support/dokumentation/docs/target-daemon-tgtd-tgtadm#show-targets

Signed-off-by: Henrik Riomar <henrik.riomar@gmail.com>
---
 tools/hotplug/Linux/block-iscsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/hotplug/Linux/block-iscsi b/tools/hotplug/Linux/block-iscsi
index 3615905252..6bbf56fe5a 100644
--- a/tools/hotplug/Linux/block-iscsi
+++ b/tools/hotplug/Linux/block-iscsi
@@ -73,7 +73,7 @@ parse_target()
 find_device()
 {
     count=0
-    while [ ! -e /dev/disk/by-path/*"$iqn"-lun-0 ]; do
+    while [ ! -e /dev/disk/by-path/*"$iqn"-lun-[01] ]; do
         sleep 1
         count=`expr $count + 1`
         if [ count = 100 ]; then
@@ -81,7 +81,7 @@ find_device()
             fatal "timeout waiting for iSCSI disk to settle"
         fi
     done
-    sddev=$(readlink -f /dev/disk/by-path/*"$iqn"-lun-0 || true)
+    sddev=$(readlink -f /dev/disk/by-path/*"$iqn"-lun-[01] || true)
     if [ ! -b "$sddev" ]; then
         fatal "Unable to find attached device path"
     fi
-- 
2.16.1

