diff --git a/doc/jsonrpc.md b/doc/jsonrpc.md index 1646a02e5..cdca15c34 100644 --- a/doc/jsonrpc.md +++ b/doc/jsonrpc.md @@ -4172,7 +4172,7 @@ Example response: } ~~~ -## set_nvmf_target_max_subsystems {#rpc_set_nvmf_target_max_subsystems} +## nvmf_set_max_subsystems {#rpc_nvmf_set_max_subsystems} Set the maximum allowed subsystems for the NVMe-oF target. This RPC may only be called before SPDK subsystems have been initialized. @@ -4191,7 +4191,7 @@ Example request: { "jsonrpc": "2.0", "id": 1, - "method": "set_nvmf_target_max_subsystems", + "method": "nvmf_set_max_subsystems", "params": { "max_subsystems": 1024 } diff --git a/lib/nvmf/nvmf.c b/lib/nvmf/nvmf.c index 300f8f773..cc810aac7 100644 --- a/lib/nvmf/nvmf.c +++ b/lib/nvmf/nvmf.c @@ -506,7 +506,7 @@ spdk_nvmf_tgt_write_config_json(struct spdk_json_write_ctx *w, struct spdk_nvmf_ struct spdk_nvmf_transport *transport; spdk_json_write_object_begin(w); - spdk_json_write_named_string(w, "method", "set_nvmf_target_max_subsystems"); + spdk_json_write_named_string(w, "method", "nvmf_set_max_subsystems"); spdk_json_write_named_object_begin(w, "params"); spdk_json_write_named_uint32(w, "max_subsystems", tgt->max_subsystems); diff --git a/module/event/subsystems/nvmf/nvmf_rpc.c b/module/event/subsystems/nvmf/nvmf_rpc.c index 76701e1e3..b14a95f0b 100644 --- a/module/event/subsystems/nvmf/nvmf_rpc.c +++ b/module/event/subsystems/nvmf/nvmf_rpc.c @@ -41,8 +41,8 @@ static const struct spdk_json_object_decoder nvmf_rpc_subsystem_tgt_opts_decoder }; static void -spdk_rpc_set_nvmf_target_max_subsystems(struct spdk_jsonrpc_request *request, - const struct spdk_json_val *params) +spdk_rpc_nvmf_set_max_subsystems(struct spdk_jsonrpc_request *request, + const struct spdk_json_val *params) { struct spdk_json_write_ctx *w; uint32_t max_subsystems = 0; @@ -70,8 +70,9 @@ spdk_rpc_set_nvmf_target_max_subsystems(struct spdk_jsonrpc_request *request, spdk_json_write_bool(w, true); spdk_jsonrpc_end_result(request, w); } -SPDK_RPC_REGISTER("set_nvmf_target_max_subsystems", spdk_rpc_set_nvmf_target_max_subsystems, +SPDK_RPC_REGISTER("nvmf_set_max_subsystems", spdk_rpc_nvmf_set_max_subsystems, SPDK_RPC_STARTUP) +SPDK_RPC_REGISTER_ALIAS_DEPRECATED(nvmf_set_max_subsystems, set_nvmf_target_max_subsystems) static int decode_conn_sched(const struct spdk_json_val *val, void *out) { diff --git a/scripts/config_converter.py b/scripts/config_converter.py index f6fa877c1..105dd16ef 100755 --- a/scripts/config_converter.py +++ b/scripts/config_converter.py @@ -30,7 +30,7 @@ iscsi_dict["iscsi_create_target_node"] = [] nvmf_dict = OrderedDict() nvmf_dict["set_nvmf_target_config"] = [] -nvmf_dict["set_nvmf_target_max_subsystems"] = [] +nvmf_dict["nvmf_set_max_subsystems"] = [] nvmf_dict["subsystems"] = [] @@ -305,7 +305,7 @@ def get_nvmf_options_json(config, section): }) nvmf_json.append({ "params": to_json_params(params[1:7]), - "method": "set_nvmf_target_max_subsystems" + "method": "nvmf_set_max_subsystems" }) return nvmf_json diff --git a/scripts/rpc.py b/scripts/rpc.py index abcd2411e..063510f4c 100755 --- a/scripts/rpc.py +++ b/scripts/rpc.py @@ -1541,13 +1541,14 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse p.set_defaults(func=net_get_interfaces) # NVMe-oF - def set_nvmf_target_max_subsystems(args): - rpc.nvmf.set_nvmf_target_max_subsystems(args.client, - max_subsystems=args.max_subsystems) + def nvmf_set_max_subsystems(args): + rpc.nvmf.nvmf_set_max_subsystems(args.client, + max_subsystems=args.max_subsystems) - p = subparsers.add_parser('set_nvmf_target_max_subsystems', help='Set the maximum number of NVMf target subsystems') + p = subparsers.add_parser('nvmf_set_max_subsystems', aliases=['set_nvmf_target_max_subsystems'], + help='Set the maximum number of NVMf target subsystems') p.add_argument('-x', '--max-subsystems', help='Max number of NVMf subsystems', type=int, required=True) - p.set_defaults(func=set_nvmf_target_max_subsystems) + p.set_defaults(func=nvmf_set_max_subsystems) def set_nvmf_target_config(args): rpc.nvmf.set_nvmf_target_config(args.client, diff --git a/scripts/rpc/nvmf.py b/scripts/rpc/nvmf.py index 227c0eccd..b5370a12e 100644 --- a/scripts/rpc/nvmf.py +++ b/scripts/rpc/nvmf.py @@ -1,8 +1,9 @@ from .helpers import deprecated_alias -def set_nvmf_target_max_subsystems(client, - max_subsystems=None): +@deprecated_alias('set_nvmf_target_max_subsystems') +def nvmf_set_max_subsystems(client, + max_subsystems=None): """Set NVMe-oF target options. Args: @@ -14,7 +15,7 @@ def set_nvmf_target_max_subsystems(client, params = {} params['max_subsystems'] = max_subsystems - return client.call('set_nvmf_target_max_subsystems', params) + return client.call('nvmf_set_max_subsystems', params) def set_nvmf_target_config(client, diff --git a/test/config_converter/spdk_config.json b/test/config_converter/spdk_config.json index 3fd383a89..3dcb565a0 100644 --- a/test/config_converter/spdk_config.json +++ b/test/config_converter/spdk_config.json @@ -185,7 +185,7 @@ "params": { "max_subsystems": 1024 }, - "method": "set_nvmf_target_max_subsystems" + "method": "nvmf_set_max_subsystems" }, { "params": { diff --git a/test/config_converter/spdk_config_virtio.json b/test/config_converter/spdk_config_virtio.json index 533ce4784..9d41d4774 100644 --- a/test/config_converter/spdk_config_virtio.json +++ b/test/config_converter/spdk_config_virtio.json @@ -91,7 +91,7 @@ "params": { "max_subsystems": 1024 }, - "method": "set_nvmf_target_max_subsystems" + "method": "nvmf_set_max_subsystems" } ] }, diff --git a/test/json_config/config_filter.py b/test/json_config/config_filter.py index 96cb8a044..3ceeb6a64 100755 --- a/test/json_config/config_filter.py +++ b/test/json_config/config_filter.py @@ -25,7 +25,7 @@ def filter_methods(do_remove_global_rpcs): global_rpcs = [ 'iscsi_set_options', 'set_nvmf_target_config', - 'set_nvmf_target_max_subsystems', + 'nvmf_set_max_subsystems', 'nvmf_create_transport', 'bdev_set_options', 'bdev_nvme_set_options',