aboutsummaryrefslogtreecommitdiffstats
path: root/main/xen/hotplug-Linux-iscsi-block-handle-lun-1.patch
blob: fdccee6c6902d5f334576f9fa8c335f553841132 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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