diff --git a/doc/jsonrpc.md b/doc/jsonrpc.md index 142b1f19d..534aeed24 100644 --- a/doc/jsonrpc.md +++ b/doc/jsonrpc.md @@ -275,7 +275,7 @@ Example response: "bdev_set_qos_limit", "bdev_get_bdevs", "bdev_get_iostat", - "get_subsystem_config", + "framework_get_config", "framework_get_subsystems", "framework_monitor_context_switch", "spdk_kill_instance", @@ -402,9 +402,9 @@ Example response: } ~~~ -## get_subsystem_config {#rpc_get_subsystem_config} +## framework_get_config {#rpc_framework_get_config} -Get current configuration of the specified SPDK subsystem +Get current configuration of the specified SPDK framework ### Parameters @@ -415,7 +415,7 @@ name | Required | string | SPDK subsystem name ### Response The response is current configuration of the specified SPDK subsystem. -Null is returned if it is not retrievable by the get_subsystem_config method and empty array is returned if it is empty. +Null is returned if it is not retrievable by the framework_get_config method and empty array is returned if it is empty. ### Example @@ -425,7 +425,7 @@ Example request: { "jsonrpc": "2.0", "id": 1, - "method": "get_subsystem_config", + "method": "framework_get_config", "params": { "name": "bdev" } diff --git a/module/event/rpc/subsystem_rpc.c b/module/event/rpc/subsystem_rpc.c index 850cb0b98..fa18013ed 100644 --- a/module/event/rpc/subsystem_rpc.c +++ b/module/event/rpc/subsystem_rpc.c @@ -74,24 +74,24 @@ spdk_rpc_framework_get_subsystems(struct spdk_jsonrpc_request *request, SPDK_RPC_REGISTER("framework_get_subsystems", spdk_rpc_framework_get_subsystems, SPDK_RPC_RUNTIME) SPDK_RPC_REGISTER_ALIAS_DEPRECATED(framework_get_subsystems, get_subsystems) -struct rpc_get_subsystem_config { +struct rpc_framework_get_config { char *name; }; -static const struct spdk_json_object_decoder rpc_get_subsystem_config[] = { - {"name", offsetof(struct rpc_get_subsystem_config, name), spdk_json_decode_string}, +static const struct spdk_json_object_decoder rpc_framework_get_config[] = { + {"name", offsetof(struct rpc_framework_get_config, name), spdk_json_decode_string}, }; static void -spdk_rpc_get_subsystem_config(struct spdk_jsonrpc_request *request, +spdk_rpc_framework_get_config(struct spdk_jsonrpc_request *request, const struct spdk_json_val *params) { - struct rpc_get_subsystem_config req = {}; + struct rpc_framework_get_config req = {}; struct spdk_json_write_ctx *w; struct spdk_subsystem *subsystem; - if (spdk_json_decode_object(params, rpc_get_subsystem_config, - SPDK_COUNTOF(rpc_get_subsystem_config), &req)) { + if (spdk_json_decode_object(params, rpc_framework_get_config, + SPDK_COUNTOF(rpc_framework_get_config), &req)) { spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS, "Invalid arguments"); return; } @@ -111,4 +111,5 @@ spdk_rpc_get_subsystem_config(struct spdk_jsonrpc_request *request, spdk_jsonrpc_end_result(request, w); } -SPDK_RPC_REGISTER("get_subsystem_config", spdk_rpc_get_subsystem_config, SPDK_RPC_RUNTIME) +SPDK_RPC_REGISTER("framework_get_config", spdk_rpc_framework_get_config, SPDK_RPC_RUNTIME) +SPDK_RPC_REGISTER_ALIAS_DEPRECATED(framework_get_config, get_subsystem_config) diff --git a/scripts/rpc.py b/scripts/rpc.py index e902c9821..bec60d359 100755 --- a/scripts/rpc.py +++ b/scripts/rpc.py @@ -1836,12 +1836,13 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse entry contain (unsorted) array of subsystems it depends on.""") p.set_defaults(func=framework_get_subsystems) - def get_subsystem_config(args): - print_dict(rpc.subsystem.get_subsystem_config(args.client, args.name)) + def framework_get_config(args): + print_dict(rpc.subsystem.framework_get_config(args.client, args.name)) - p = subparsers.add_parser('get_subsystem_config', help="""Print subsystem configuration""") + p = subparsers.add_parser('framework_get_config', aliases=['get_subsystem_config'], + help="""Print subsystem configuration""") p.add_argument('name', help='Name of subsystem to query') - p.set_defaults(func=get_subsystem_config) + p.set_defaults(func=framework_get_config) # vhost def set_vhost_controller_coalescing(args): diff --git a/scripts/rpc/__init__.py b/scripts/rpc/__init__.py index 0465d922a..a0f715327 100644 --- a/scripts/rpc/__init__.py +++ b/scripts/rpc/__init__.py @@ -79,7 +79,7 @@ def save_config(client, fd, indent=2): for elem in client.call('framework_get_subsystems'): cfg = { 'subsystem': elem['subsystem'], - 'config': client.call('get_subsystem_config', {"name": elem['subsystem']}) + 'config': client.call('framework_get_config', {"name": elem['subsystem']}) } config['subsystems'].append(cfg) @@ -149,7 +149,7 @@ def save_subsystem_config(client, fd, indent=2, name=None): """ cfg = { 'subsystem': name, - 'config': client.call('get_subsystem_config', {"name": name}) + 'config': client.call('framework_get_config', {"name": name}) } _json_dump(cfg, fd, indent) diff --git a/scripts/rpc/subsystem.py b/scripts/rpc/subsystem.py index 702dc0cb4..a52adbf6b 100644 --- a/scripts/rpc/subsystem.py +++ b/scripts/rpc/subsystem.py @@ -6,6 +6,7 @@ def framework_get_subsystems(client): return client.call('framework_get_subsystems') -def get_subsystem_config(client, name): +@deprecated_alias('get_subsystem_config') +def framework_get_config(client, name): params = {'name': name} - return client.call('get_subsystem_config', params) + return client.call('framework_get_config', params) diff --git a/test/json_config/clear_config.py b/test/json_config/clear_config.py index 0c62fa760..ee679841f 100755 --- a/test/json_config/clear_config.py +++ b/test/json_config/clear_config.py @@ -185,7 +185,7 @@ if __name__ == "__main__": @call_test_cmd def clear_subsystem(args): - config = args.client.call('get_subsystem_config', {"name": args.subsystem}) + config = args.client.call('framework_get_config', {"name": args.subsystem}) if config is None: return if args.verbose: diff --git a/test/nvmf/host/perf.sh b/test/nvmf/host/perf.sh index 5e8b579d7..d67cf1fc4 100755 --- a/test/nvmf/host/perf.sh +++ b/test/nvmf/host/perf.sh @@ -17,7 +17,7 @@ nvmfappstart "-m 0xF" $rootdir/scripts/gen_nvme.sh --json | $rpc_py load_subsystem_config -local_nvme_trid="trtype:PCIe traddr:"$($rpc_py get_subsystem_config bdev | jq -r '.[].params | select(.name=="Nvme0").traddr') +local_nvme_trid="trtype:PCIe traddr:"$($rpc_py framework_get_config bdev | jq -r '.[].params | select(.name=="Nvme0").traddr') bdevs="$bdevs $($rpc_py bdev_malloc_create $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE)" if [ -n "$local_nvme_trid" ]; then