[libvirt] [PATCH] viriscsi: Need to sendtargets on Initiator IQN

https://bugzilla.redhat.com/show_bug.cgi?id=1172015 The refactoring done as part of commit id '59446096' caused a regression for the multi initiator IQN commit '6aabcb5b' because the sendtargets was not done on/for the initiator IQN prior to login (or trying to disable autologin) Prior to that commit, the paths were essentially virStorageBackendISCSIStartPool virStorageBackendISCSILogin virStorageBackendISCSIConnection if initiatoriqn virStorageBackendCreateIfaceIQN Issue sendtargets Perform --login else Issue sendtargets Perform --login After that commit: virStorageBackendISCSIStartPool Issue sendtargets Call virStorageBackendISCSIConnection If initiatoriqn virStorageBackendCreateIfaceIQN Perform --login else Perform --login So for non initiator IQN paths, nothing changed. For the initiator path, the --login fails as does any attempts to change autologin via "--op update --name node.startup --value manual". Signed-off-by: John Ferlan <jferlan@redhat.com> --- NOTE: I tried to move "Issue sendtargets" to inside virStorageBackendISCSIConnection; however, that caused issues for my authenticated iSCSI pool. I have to assume that sendtargets being run before the iscsiadm commands to set the auth data require that sendtargets as well. So I just repeated the call for the very specific case of after the CreateIfaceIQN succeeds. src/util/viriscsi.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/util/viriscsi.c b/src/util/viriscsi.c index ef8fb59..bd34fea 100644 --- a/src/util/viriscsi.c +++ b/src/util/viriscsi.c @@ -295,10 +295,17 @@ virISCSIConnection(const char *portal, VIR_DEBUG("ifacename: '%s'", ifacename); break; case IQN_MISSING: - if (virStorageBackendCreateIfaceIQN(initiatoriqn, - &ifacename) != 0) { + if (virStorageBackendCreateIfaceIQN(initiatoriqn, &ifacename) != 0) goto cleanup; - } + /* + * iscsiadm doesn't let you send commands to the Interface IQN, + * unless you've first issued a 'sendtargets' command to the + * portal. Without the sendtargets all that is received is a + * "iscsiadm: No records found" + */ + if (virISCSIScanTargets(portal, initiatoriqn, NULL, NULL) < 0) + goto cleanup; + break; case IQN_ERROR: default: -- 1.9.3

On 12/10/2014 01:12 AM, John Ferlan wrote:
https://bugzilla.redhat.com/show_bug.cgi?id=1172015
The refactoring done as part of commit id '59446096' caused a regression
Wow, that was over 4 years ago.
for the multi initiator IQN commit '6aabcb5b' because the sendtargets was not done on/for the initiator IQN prior to login (or trying to disable autologin)
...
src/util/viriscsi.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
ACK Jan

On 12/10/2014 10:34 AM, Ján Tomko wrote:
On 12/10/2014 01:12 AM, John Ferlan wrote:
https://bugzilla.redhat.com/show_bug.cgi?id=1172015
The refactoring done as part of commit id '59446096' caused a regression
Wow, that was over 4 years ago.
It's not even documented on the storage pool XML page: http://libvirt.org/formatstorage.html That would explain it. Jan
for the multi initiator IQN commit '6aabcb5b' because the sendtargets was not done on/for the initiator IQN prior to login (or trying to disable autologin)
...
src/util/viriscsi.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
ACK
Jan
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

On 12/10/2014 04:45 AM, Ján Tomko wrote:
On 12/10/2014 10:34 AM, Ján Tomko wrote:
On 12/10/2014 01:12 AM, John Ferlan wrote:
https://bugzilla.redhat.com/show_bug.cgi?id=1172015
The refactoring done as part of commit id '59446096' caused a regression
Wow, that was over 4 years ago.
It's not even documented on the storage pool XML page: http://libvirt.org/formatstorage.html
That would explain it.
I thought about that too, but I'm not sure even I could describe the functionality or valid configuration options. This is now pushed. Thanks for the quick review! John
participants (2)
-
John Ferlan
-
Ján Tomko