From 61385feeac8ef04089ccb9055a85c059d35c43ca Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Tue, 30 Oct 2018 23:25:06 -0700 Subject: [PATCH] thread: print error for io_devices at lib fini All io_devices should be unregistered before the application exits. If not, print an error message for each io_device that still exists. Eventually we may want to assert() if any io_devices are found, but for now we'll just stick with the error message. Signed-off-by: Jim Harris Change-Id: If017edf40fc2904ed772bc1c6124f06fc9b49bcd Reviewed-on: https://review.gerrithub.io/433202 Tested-by: SPDK CI Jenkins Chandler-Test-Pool: SPDK Automated Test System Reviewed-by: Darek Stojaczyk Reviewed-by: Changpeng Liu Reviewed-by: Shuhei Matsumoto Reviewed-by: Paul Luse Reviewed-by: Ben Walker --- lib/thread/thread.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/thread/thread.c b/lib/thread/thread.c index 11cc19670..dd72b8f27 100644 --- a/lib/thread/thread.c +++ b/lib/thread/thread.c @@ -158,6 +158,11 @@ spdk_thread_lib_init(void) void spdk_thread_lib_fini(void) { + struct io_device *dev; + + TAILQ_FOREACH(dev, &g_io_devices, tailq) { + SPDK_ERRLOG("io_device %s not unregistered\n", dev->name); + } } struct spdk_thread *