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>
This commit is contained in:
Chris Lalancette 2008-06-17 12:47:10 +00:00
parent 88dd6f6cc2
commit 94e3ba0e87

View 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");
}