mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
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:
parent
88dd6f6cc2
commit
94e3ba0e87
@ -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");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user