From fe3ac8e5c7e4dfdbcbb5d55f80672df71ed81529 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Wed, 19 Oct 2016 09:31:54 -0700 Subject: [PATCH] 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 --- lib/rpc/rpc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/rpc/rpc.c b/lib/rpc/rpc.c index 8ee2c8d29..d0e888701 100644 --- a/lib/rpc/rpc.c +++ b/lib/rpc/rpc.c @@ -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); }