Hello Nir Soffer, Federico Simoncelli,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/26656

to review the following change.

Change subject: hsm: Distinguish between iface and initiator when creating 
iSCSI iface
......................................................................

hsm: Distinguish between iface and initiator when creating iSCSI iface

VDSM mistakely assumed that iface name and iface initiator name are the
same, so if admin configured specific initiator name in the host its
value is mistakenly overwritten by ifaceName in the iface file. In such
a case the host fails to establish the iSCSI connection with the target.

Change-Id: I2ea42e63e3e09babaa283c4e97e341ff259a6945
Signed-off-by: Sergey Gotliv <[email protected]>
Reviewed-on: http://gerrit.ovirt.org/25628
Reviewed-by: Nir Soffer <[email protected]>
Reviewed-by: Federico Simoncelli <[email protected]>
---
M vdsm/storage/hsm.py
1 file changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/56/26656/1

diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 03703bc..2296448 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -148,7 +148,7 @@
     sd.GLUSTERFS_DOMAIN: 'glusterfs'}
 
 
-def _BCInitiatorNameResolve(ifaceName):
+def _BCInitiatorNameResolve(ifaceName, initiatorName):
     if not ifaceName:
         return iscsi.IscsiInterface('default')
 
@@ -156,7 +156,7 @@
         if iface.name == ifaceName:
             return iface
 
-    iface = iscsi.IscsiInterface(ifaceName, initiatorName=ifaceName)
+    iface = iscsi.IscsiInterface(ifaceName, initiatorName=initiatorName)
     iface.create()
     return iface
 
@@ -230,7 +230,8 @@
 
         target = iscsi.IscsiTarget(portal, tpgt, conDict.get('iqn', None))
 
-        iface = _BCInitiatorNameResolve(conDict.get('initiatorName', None))
+        iface = _BCInitiatorNameResolve(conDict.get('ifaceName', None),
+                                        conDict.get('initiatorName', None))
 
         cred = None
         username = conDict.get('user', None)


-- 
To view, visit http://gerrit.ovirt.org/26656
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2ea42e63e3e09babaa283c4e97e341ff259a6945
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.4
Gerrit-Owner: Sergey Gotliv <[email protected]>
Gerrit-Reviewer: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Nir Soffer <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to