[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[libvirt] [RFC 4/5]: Move the sendtarget command into the login command
- From: Chris Lalancette <clalance redhat com>
- To: libvir-list redhat com
- Subject: [libvirt] [RFC 4/5]: Move the sendtarget command into the login command
- Date: Thu, 12 Jun 2008 16:09:13 +0200
A small bugfix; we only need to call the iscsiadm sendtarget command when we are
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>
--- libvirt.iscsi-mode-session/src/storage_backend_iscsi.c 2008-06-12 15:29:04.000000000 +0200
+++ libvirt/src/storage_backend_iscsi.c 2008-06-12 15:31:00.000000000 +0200
@@ -158,14 +158,6 @@ virStorageBackendISCSIConnection(virConn
"--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(virConnectPt
virStoragePoolObjPtr pool,
const char *portal)
{
+ const char *cmdsendtarget[] = {
+ ISCSIADM, "--mode", "discovery", "--type", "sendtargets",
+ "--portal", portal, NULL
+ };
+
+ if (virRun(conn, (char **)cmdsendtarget, NULL) < 0)
+ return -1;
+
return virStorageBackendISCSIConnection(conn, pool, portal, "--login");
}
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]