iscsi: wait with spdk_app_stop until poller is unregistered

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I9218b618544def301a4509eda1b266390a80dba5
Reviewed-on: https://review.gerrithub.io/382830
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
Tomasz Zawadzki 2017-10-17 16:20:01 +02:00 committed by Jim Harris
parent c0ed81a72b
commit 4768b198da

View File

@ -752,13 +752,22 @@ spdk_iscsi_conns_cleanup(void)
shm_unlink(g_shm_name); shm_unlink(g_shm_name);
} }
static void
spdk_iscsi_conn_check_shutdown_cb(void *arg1, void *arg2)
{
spdk_iscsi_conns_cleanup();
spdk_app_stop(0);
}
static void static void
spdk_iscsi_conn_check_shutdown(void *arg) spdk_iscsi_conn_check_shutdown(void *arg)
{ {
struct spdk_event *event;
if (spdk_iscsi_get_active_conns() == 0) { if (spdk_iscsi_get_active_conns() == 0) {
spdk_poller_unregister(&g_shutdown_timer, NULL); event = spdk_event_allocate(spdk_env_get_current_core(), spdk_iscsi_conn_check_shutdown_cb, NULL,
spdk_iscsi_conns_cleanup(); NULL);
spdk_app_stop(0); spdk_poller_unregister(&g_shutdown_timer, event);
} }
} }