Commit 5dc80812 authored by Jim Harris's avatar Jim Harris Committed by Tomasz Zawadzki
Browse files

init: add spdk_subsystem_exists()



We can use this to determine if any given subsystem has been linked into
the application.

Signed-off-by: default avatarJim Harris <jim.harris@samsung.com>
Change-Id: Ib2af6f0b5480091476c44e85404320ada213e251
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/22779


Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
parent 9c9f7ddb
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -122,6 +122,14 @@ typedef void (*spdk_subsystem_fini_fn)(void *ctx);
 */
void spdk_subsystem_fini(spdk_subsystem_fini_fn cb_fn, void *cb_arg);

/**
 * Check if the specified subsystem exists in the application.
 *
 * \param name Name of the subsystem to look for
 * \return true if it exists, false if not
 */
bool spdk_subsystem_exists(const char *name);

/**
 * Pause polling RPC server with given address.
 *
+1 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@
	spdk_subsystem_init_next;
	spdk_subsystem_fini_next;
	spdk_subsystem_init_from_json_config;
	spdk_subsystem_exists;

	spdk_rpc_initialize;
	spdk_rpc_finish;
+6 −0
Original line number Diff line number Diff line
@@ -63,6 +63,12 @@ subsystem_find(const char *name)
	return _subsystem_find(&g_subsystems, name);
}

bool
spdk_subsystem_exists(const char *name)
{
	return subsystem_find(name) != NULL;
}

struct spdk_subsystem *
subsystem_get_first(void)
{