lib/iscsi: Add target to iscsi_conns_start_exit() as an argument
When target is specified, the function starts exiting any connection that belongs to the target. When target is not specified, the function starts exiting all connections. Change-Id: I0dfb56ceac5ee36d10547a9ab9a0f768ca8e02ec Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450734 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
170d18f0d4
commit
13935275fb
@ -768,7 +768,7 @@ iscsi_conn_stop(struct spdk_iscsi_conn *conn)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
iscsi_conns_start_exit(void)
|
iscsi_conns_start_exit(struct spdk_iscsi_tgt_node *target)
|
||||||
{
|
{
|
||||||
struct spdk_iscsi_conn *conn;
|
struct spdk_iscsi_conn *conn;
|
||||||
int i;
|
int i;
|
||||||
@ -781,6 +781,10 @@ iscsi_conns_start_exit(void)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (target != NULL && conn->target != target) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/* Do not set conn->state if the connection has already started exiting.
|
/* Do not set conn->state if the connection has already started exiting.
|
||||||
* This ensures we do not move a connection from EXITED state back to EXITING.
|
* This ensures we do not move a connection from EXITED state back to EXITING.
|
||||||
*/
|
*/
|
||||||
@ -795,7 +799,7 @@ iscsi_conns_start_exit(void)
|
|||||||
void
|
void
|
||||||
spdk_shutdown_iscsi_conns(void)
|
spdk_shutdown_iscsi_conns(void)
|
||||||
{
|
{
|
||||||
iscsi_conns_start_exit();
|
iscsi_conns_start_exit(NULL);
|
||||||
|
|
||||||
g_shutdown_timer = spdk_poller_register(iscsi_conn_check_shutdown, NULL, 1000);
|
g_shutdown_timer = spdk_poller_register(iscsi_conn_check_shutdown, NULL, 1000);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user