Commit 874550d7 authored by Jim Harris's avatar Jim Harris Committed by Tomasz Zawadzki
Browse files

lib/init: do not fail on missing RPC when stop_on_error is not set



SPDK apps support --json-ignore-init-errors option, to allow
continuing past RPCs that might fail.

But this was only working for RPCs that actually exist, and
then fail execution. It did not work for RPCs that didn't exist
at all. For example, if you save a JSON config from a running
spdk_tgt, it will include a lot of RPCs (nvmf, iscsi) that
don't exist in an app like bdevperf.

So fix up app_json_config_load_subsystem_config_entry() so that it
just continues to the next RPC if it finds an RPC call that doesn't
exist.

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


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Mellanox Build Bot
parent 17ae5e07
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -352,8 +352,14 @@ app_json_config_load_subsystem_config_entry(void *_ctx)

	rc = spdk_rpc_get_method_state_mask(cfg.method, &state_mask);
	if (rc == -ENOENT) {
		if (!ctx->stop_on_error) {
			/* Invoke later to avoid recursion */
			ctx->config_it = spdk_json_next(ctx->config_it);
			spdk_thread_send_msg(ctx->thread, app_json_config_load_subsystem_config_entry, ctx);
		} else {
			SPDK_ERRLOG("Method '%s' was not found\n", cfg.method);
			app_json_config_load_done(ctx, rc);
		}
		goto out;
	}
	cur_state_mask = spdk_rpc_get_state();