Commit e85d4712 authored by Maciej Wawryk's avatar Maciej Wawryk Committed by Jim Harris
Browse files

RPC: rename start_subsystem_init to framework_start_init

parent 68ee93aa
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -76,12 +76,12 @@ SPDK applications progress through a set of states beginning with `STARTUP` and
ending with `RUNTIME`.

If the `--wait-for-rpc` parameter is provided SPDK will pause just before starting
subsystem initialization. This state is called `STARTUP`. The JSON RPC server is
ready but only a small subsystem of commands are available to set up initialization
framework initialization. This state is called `STARTUP`. The JSON RPC server is
ready but only a small subset of commands are available to set up initialization
parameters. Those parameters can't be changed after the SPDK application enters
`RUNTIME` state. When the client finishes configuring the SPDK subsystems it
needs to issue the @ref rpc_start_subsystem_init RPC command to begin the
initialization process. After `rpc_start_subsystem_init` returns `true` SPDK
needs to issue the @ref rpc_framework_start_init RPC command to begin the
initialization process. After `rpc_framework_start_init` returns `true` SPDK
will enter the `RUNTIME` state and the list of available commands becomes much
larger.

+4 −4
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ for any kind of error.

Code   | Description
------ | -----------
-1     | Invalid state - given method exists but it is not callable in [current runtime state](@ref rpc_start_subsystem_init)
-1     | Invalid state - given method exists but it is not callable in [current runtime state](@ref rpc_framework_start_init)
-32600 | Invalid request - not compliant with JSON-RPC 2.0 Specification
-32601 | Method not found
-32602 | @ref jsonrpc_invalid_params
@@ -134,7 +134,7 @@ Example response:
}
~~~

## start_subsystem_init {#rpc_start_subsystem_init}
## framework_start_init {#rpc_framework_start_init}

Start initialization of SPDK subsystems when it is deferred by starting SPDK application with option -w.
During its deferral some RPCs can be used to set global parameters for SPDK subsystems.
@@ -156,7 +156,7 @@ Example request:
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "start_subsystem_init"
  "method": "framework_start_init"
}
~~~

@@ -238,7 +238,7 @@ Example response:
  "jsonrpc": "2.0",
  "id": 1,
  "result": [
    "start_subsystem_init",
    "framework_start_init",
    "rpc_get_methods",
    "get_scsi_devices",
    "net_get_interfaces",
+7 −6
Original line number Diff line number Diff line
@@ -1056,7 +1056,7 @@ spdk_app_usage(void)
}

static void
spdk_rpc_start_subsystem_init_cpl(int rc, void *arg1)
spdk_rpc_framework_start_init_cpl(int rc, void *arg1)
{
	struct spdk_jsonrpc_request *request = arg1;
	struct spdk_json_write_ctx *w;
@@ -1065,7 +1065,7 @@ spdk_rpc_start_subsystem_init_cpl(int rc, void *arg1)

	if (rc) {
		spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR,
						 "subsystem_initialization failed");
						 "framework_initialization failed");
		return;
	}

@@ -1078,18 +1078,19 @@ spdk_rpc_start_subsystem_init_cpl(int rc, void *arg1)
}

static void
spdk_rpc_start_subsystem_init(struct spdk_jsonrpc_request *request,
spdk_rpc_framework_start_init(struct spdk_jsonrpc_request *request,
			      const struct spdk_json_val *params)
{
	if (params != NULL) {
		spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS,
						 "start_subsystem_init requires no parameters");
						 "framework_start_init requires no parameters");
		return;
	}

	spdk_subsystem_init(spdk_rpc_start_subsystem_init_cpl, request);
	spdk_subsystem_init(spdk_rpc_framework_start_init_cpl, request);
}
SPDK_RPC_REGISTER("start_subsystem_init", spdk_rpc_start_subsystem_init, SPDK_RPC_STARTUP)
SPDK_RPC_REGISTER("framework_start_init", spdk_rpc_framework_start_init, SPDK_RPC_STARTUP)
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(framework_start_init, start_subsystem_init)

struct subsystem_init_poller_ctx {
	struct spdk_poller *init_poller;
+3 −3
Original line number Diff line number Diff line
@@ -401,7 +401,7 @@ subsystem_init_done(int rc, void *arg1)

	spdk_rpc_set_state(SPDK_RPC_RUNTIME);
	/* Another round. This time for RUNTIME methods */
	SPDK_DEBUG_APP_CFG("'start_subsystem_init' done - continuing configuration\n");
	SPDK_DEBUG_APP_CFG("'framework_start_init' done - continuing configuration\n");

	assert(ctx != NULL);
	if (ctx->subsystems) {
@@ -424,7 +424,7 @@ static struct spdk_json_object_decoder subsystem_decoders[] = {
 * There are two iterations:
 *
 * In first iteration only STARTUP RPC methods are used, other methods are ignored. When
 * allsubsystems are walked the ctx->subsystems_it became NULL and "start_subsystem_init"
 * allsubsystems are walked the ctx->subsystems_it became NULL and "framework_start_init"
 * is called to let the SPDK move to RUNTIME state (initialize all subsystems) and
 * second iteration begins.
 *
@@ -440,7 +440,7 @@ spdk_app_json_config_load_subsystem(void *_ctx)

	if (ctx->subsystems_it == NULL) {
		if (spdk_rpc_get_state() == SPDK_RPC_STARTUP) {
			SPDK_DEBUG_APP_CFG("No more entries for current state, calling 'start_subsystem_init'\n");
			SPDK_DEBUG_APP_CFG("No more entries for current state, calling 'framework_start_init'\n");
			spdk_subsystem_init(subsystem_init_done, ctx);
		} else {
			spdk_app_json_config_load_done(ctx, 0);
+5 −4
Original line number Diff line number Diff line
@@ -39,11 +39,12 @@ if __name__ == "__main__":
    parser.set_defaults(dry_run=False)
    subparsers = parser.add_subparsers(help='RPC methods', dest='called_rpc_name')

    def start_subsystem_init(args):
        rpc.start_subsystem_init(args.client)
    def framework_start_init(args):
        rpc.framework_start_init(args.client)

    p = subparsers.add_parser('start_subsystem_init', help='Start initialization of subsystems')
    p.set_defaults(func=start_subsystem_init)
    p = subparsers.add_parser('framework_start_init', aliases=['start_subsystem_init'],
                              help='Start initialization of subsystems')
    p.set_defaults(func=framework_start_init)

    def wait_subsystem_init(args):
        rpc.wait_subsystem_init(args.client)
Loading