]> xenbits.xensource.com Git - libvirt.git/commitdiff
A small bugfix; we only need to call the iscsiadm sendtarget command when we are
authorChris Lalancette <clalance@redhat.com>
Tue, 17 Jun 2008 12:47:10 +0000 (12:47 +0000)
committerChris Lalancette <clalance@redhat.com>
Tue, 17 Jun 2008 12:47:10 +0000 (12:47 +0000)
first logging in; we don't need to do it for logout.  Move the sendtarget
command into the Login() function.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
src/storage_backend_iscsi.c

index 78a623cdbce22cc2d4a971ea461a0ce14cf4ed89..32228a5ce572c30730b634420cd50ed3decf0043 100644 (file)
@@ -158,14 +158,6 @@ virStorageBackendISCSIConnection(virConnectPtr conn,
         "--targetname", pool->def->source.devices[0].path, action, NULL
     };
 
-    const char *cmdsendtarget[] = {
-        ISCSIADM, "--mode", "discovery", "--type", "sendtargets",
-        "--portal", portal, NULL
-    };
-
-    if (virRun(conn, (char **)cmdsendtarget, NULL) < 0)
-        return -1;
-
     if (virRun(conn, (char **)cmdargv, NULL) < 0)
         return -1;
 
@@ -403,6 +395,14 @@ virStorageBackendISCSILogin(virConnectPtr conn,
                             virStoragePoolObjPtr pool,
                             const char *portal)
 {
+    const char *const cmdsendtarget[] = {
+        ISCSIADM, "--mode", "discovery", "--type", "sendtargets",
+        "--portal", portal, NULL
+    };
+
+    if (virRun(conn, (char **)cmdsendtarget, NULL) < 0)
+        return -1;
+
     return virStorageBackendISCSIConnection(conn, pool, portal, "--login");
 }