]> xenbits.xensource.com Git - libvirt.git/commitdiff
iscsi: Establish connection to target via static target login
authorJohn Ferlan <jferlan@redhat.com>
Sat, 16 Jul 2016 12:15:03 +0000 (08:15 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 28 Jul 2016 12:27:13 +0000 (08:27 -0400)
https://bugzilla.redhat.com/show_bug.cgi?id=1356436

Commit id '56057900' altered the discovery of iSCSI node targets by
using the "--op nonpersistent". This caused issues for clean environments
or if by chance a "-m node -o delete" was executed.

Since each iSCSI Storage Pool has the required iSCSI target path, use
that and the virISCSINodeNew API in order to generate the iSCSI node record.

src/storage/storage_backend_iscsi.c

index bb33da239b21bb07013866c3672ac27e57322d86..84ad6f3e8717c193d58ea737c08566e479175bad 100644 (file)
@@ -353,11 +353,10 @@ virStorageBackendISCSIStartPool(virConnectPtr conn,
     if ((session = virStorageBackendISCSISession(pool, true)) == NULL) {
         if ((portal = virStorageBackendISCSIPortal(&pool->def->source)) == NULL)
             goto cleanup;
-        /*
-         * iscsiadm doesn't let you login to a target, unless you've
-         * first issued a 'sendtargets' command to the portal :-(
-         */
-        if (virISCSIScanTargets(portal, NULL, NULL) < 0)
+
+        /* Create a static node record for the IQN target. Must be done
+         * in order for login to the target */
+        if (virISCSINodeNew(portal, pool->def->source.devices[0].path) < 0)
             goto cleanup;
 
         if (virStorageBackendISCSISetAuth(portal, conn, &pool->def->source) < 0)