Commit 13935275 authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Ben Walker
Browse files

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: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450734


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 170d18f0
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -768,7 +768,7 @@ iscsi_conn_stop(struct spdk_iscsi_conn *conn)
}

static void
iscsi_conns_start_exit(void)
iscsi_conns_start_exit(struct spdk_iscsi_tgt_node *target)
{
	struct spdk_iscsi_conn	*conn;
	int			i;
@@ -781,6 +781,10 @@ iscsi_conns_start_exit(void)
			continue;
		}

		if (target != NULL && conn->target != target) {
			continue;
		}

		/* 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.
		  */
@@ -795,7 +799,7 @@ iscsi_conns_start_exit(void)
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);
}