rpc: always unregister RPC setup poller

Previously, if spdk_rpc_setup() returned early due to the RPC service
being disabled in the configuration file, it would leave itself
registered as a poller and continue to run for the life of the app.

Change-Id: I0532fe23a732b87d68f83847b2db7627f87e9a1c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2016-10-19 09:31:54 -07:00 committed by Ben Walker
parent f64690d49a
commit fe3ac8e5c7

View File

@ -139,6 +139,9 @@ spdk_rpc_setup(void *arg)
struct sockaddr_in serv_addr;
uint16_t port;
/* Unregister the one-shot setup poller */
spdk_poller_unregister(&g_rpc_poller, NULL);
if (!enable_rpc()) {
return;
}
@ -157,8 +160,7 @@ spdk_rpc_setup(void *arg)
return;
}
/* Unregister the one-shot setup and register the periodic rpc_server_do_work */
spdk_poller_unregister(&g_rpc_poller, NULL);
/* Register the periodic rpc_server_do_work */
spdk_poller_register(&g_rpc_poller, spdk_rpc_server_do_work, NULL, spdk_app_get_current_core(),
NULL, RPC_SELECT_INTERVAL);
}