rpc: Remove event from module unload path

By the time the module is unloaded, the reactors
have already stopped. That means the event will never
actually fire. Simply remove it.

Change-Id: I4fe371ae7a679d51254d0267fbbbf74c3e9cf477
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Ben Walker 2017-02-23 14:09:24 -07:00 committed by Jim Harris
parent 963777ca36
commit 4044f8b62e

View File

@ -261,27 +261,20 @@ spdk_rpc_initialize(void)
return 0;
}
static void
spdk_rpc_finish_cleanup(void *arg1, void *arg2)
{
if (g_jsonrpc_server) {
spdk_jsonrpc_server_shutdown(g_jsonrpc_server);
}
}
static int
spdk_rpc_finish(void)
{
struct spdk_event *complete;
if (g_rpc_listen_addr_unix.sun_path[0]) {
/* Delete the Unix socket file */
unlink(g_rpc_listen_addr_unix.sun_path);
}
complete = spdk_event_allocate(spdk_app_get_current_core(), spdk_rpc_finish_cleanup,
NULL, NULL);
spdk_poller_unregister(&g_rpc_poller, complete);
spdk_poller_unregister(&g_rpc_poller, NULL);
if (g_jsonrpc_server) {
spdk_jsonrpc_server_shutdown(g_jsonrpc_server);
}
return 0;
}