Commit 6d5c2d2b authored by GangCao's avatar GangCao Committed by Jim Harris
Browse files

io_channel: add the check for the existence of poller_fn



There existing some cases like in our UT code, the
start_poller_fn and stop_poller_fn is not configured.
Add a check here and properly handle these cases.

Change-Id: Iaac83d78547432584f6de0c54e9d2e06b9b35741
Signed-off-by: default avatarGangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/392996


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 583a24a4
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -208,6 +208,11 @@ spdk_poller_register(spdk_poller_fn fn,
		abort();
	}

	if (!thread->start_poller_fn || !thread->stop_poller_fn) {
		SPDK_ERRLOG("No related functions to start requested poller\n");
		abort();
	}

	poller = thread->start_poller_fn(thread->thread_ctx, fn, arg, period_microseconds);
	if (!poller) {
		SPDK_ERRLOG("Unable to start requested poller\n");