提交 94e3ba0e 编写于 作者: C Chris Lalancette

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: NChris Lalancette <clalance@redhat.com>
上级 88dd6f6c
......@@ -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");
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册