lib/bdev: build bdev_wait_for_examine into subsystem

Since user/orchestration has no chance to call
bdev_wait_for_examine when loading json configuration,
this RPC is now always built into bdev subsystem json.

This behaviour was already there for SPDK_RPC_STARTUP,
see bdev_module_action_complete().
Yet it did not apply to SPDK_RPC_RUNTIME RPCs, as the
bdev module initialization was already complete.

Making sure all SPDK applications finish their startup
when all bdevs are ready to be used. See issue below:

Fixes #1675

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I0f60f56932da020a15deeef09a5a1544f3a1bae6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5481
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Tomasz Zawadzki 2020-12-08 07:56:20 -05:00
parent c5c7de44f3
commit e57bb1afb8
3 changed files with 9 additions and 1 deletions

View File

@ -11,7 +11,9 @@ parameter in spdk_bdev_get_opts function. Two fields `small_buf_pool_size` and
the small and large buffer pool size of the whole bdev module.
A new API `spdk_bdev_wait_for_examine` was added to allow for checking state of
examine process. Along with corresponding `bdev_wait_for_examine` RPC.
examine process. Along with corresponding `bdev_wait_for_examine` RPC, which
is now always called during `spdk_bdev_subsystem_config_json` making sure
every bdev is ready to be used.
### blob

View File

@ -1152,6 +1152,11 @@ spdk_bdev_subsystem_config_json(struct spdk_json_write_ctx *w)
pthread_mutex_unlock(&g_bdev_mgr.mutex);
/* This has to be last RPC in array to make sure all bdevs finished examine */
spdk_json_write_object_begin(w);
spdk_json_write_named_string(w, "method", "bdev_wait_for_examine");
spdk_json_write_object_end(w);
spdk_json_write_array_end(w);
}

View File

@ -29,6 +29,7 @@ def filter_methods(do_remove_global_rpcs):
'nvmf_set_max_subsystems',
'nvmf_create_transport',
'bdev_set_options',
'bdev_wait_for_examine',
'bdev_nvme_set_options',
'bdev_nvme_set_hotplug',
'sock_impl_set_options',