diff --git a/doc/jsonrpc.md b/doc/jsonrpc.md index 079eda2535..e3030193cb 100644 --- a/doc/jsonrpc.md +++ b/doc/jsonrpc.md @@ -3776,7 +3776,7 @@ Example response: } ~~~ -## get_nvmf_subsystems method {#rpc_get_nvmf_subsystems} +## nvmf_get_subsystems method {#rpc_nvmf_get_subsystems} ### Parameters @@ -3792,7 +3792,7 @@ Example request: { "jsonrpc": "2.0", "id": 1, - "method": "get_nvmf_subsystems" + "method": "nvmf_get_subsystems" } ~~~ diff --git a/lib/nvmf/nvmf_rpc.c b/lib/nvmf/nvmf_rpc.c index ae736d9fd9..311ea84d45 100644 --- a/lib/nvmf/nvmf_rpc.c +++ b/lib/nvmf/nvmf_rpc.c @@ -299,7 +299,7 @@ dump_nvmf_subsystem(struct spdk_json_write_ctx *w, struct spdk_nvmf_subsystem *s } static void -spdk_rpc_get_nvmf_subsystems(struct spdk_jsonrpc_request *request, +spdk_rpc_nvmf_get_subsystems(struct spdk_jsonrpc_request *request, const struct spdk_json_val *params) { struct rpc_get_subsystem req = { 0 }; @@ -336,7 +336,8 @@ spdk_rpc_get_nvmf_subsystems(struct spdk_jsonrpc_request *request, spdk_jsonrpc_end_result(request, w); free(req.tgt_name); } -SPDK_RPC_REGISTER("get_nvmf_subsystems", spdk_rpc_get_nvmf_subsystems, SPDK_RPC_RUNTIME) +SPDK_RPC_REGISTER("nvmf_get_subsystems", spdk_rpc_nvmf_get_subsystems, SPDK_RPC_RUNTIME) +SPDK_RPC_REGISTER_ALIAS_DEPRECATED(nvmf_get_subsystems, get_nvmf_subsystems) struct rpc_subsystem_create { char *nqn; diff --git a/scripts/perf/nvmf/run_nvmf.py b/scripts/perf/nvmf/run_nvmf.py index 14eaf8c85d..d0e42038a3 100755 --- a/scripts/perf/nvmf/run_nvmf.py +++ b/scripts/perf/nvmf/run_nvmf.py @@ -528,7 +528,7 @@ class SPDKTarget(Target): adrfam="ipv4") self.log_print("SPDK NVMeOF subsystem configuration:") - rpc.client.print_dict(rpc.nvmf.get_nvmf_subsystems(self.client)) + rpc.client.print_dict(rpc.nvmf.nvmf_get_subsystems(self.client)) def tgt_start(self): self.subsys_no = get_nvme_devices_count() diff --git a/scripts/rpc.py b/scripts/rpc.py index 64e1789dc1..140b8303eb 100755 --- a/scripts/rpc.py +++ b/scripts/rpc.py @@ -1624,13 +1624,13 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse p.add_argument('-t', '--tgt_name', help='The name of the parent NVMe-oF target (optional)', type=str) p.set_defaults(func=get_nvmf_transports) - def get_nvmf_subsystems(args): - print_dict(rpc.nvmf.get_nvmf_subsystems(args.client, tgt_name=args.tgt_name)) + def nvmf_get_subsystems(args): + print_dict(rpc.nvmf.nvmf_get_subsystems(args.client, tgt_name=args.tgt_name)) - p = subparsers.add_parser('get_nvmf_subsystems', + p = subparsers.add_parser('nvmf_get_subsystems', aliases=['get_nvmf_subsystems'], help='Display nvmf subsystems') p.add_argument('-t', '--tgt_name', help='The name of the parent NVMe-oF target (optional)', type=str) - p.set_defaults(func=get_nvmf_subsystems) + p.set_defaults(func=nvmf_get_subsystems) def nvmf_subsystem_create(args): rpc.nvmf.nvmf_subsystem_create(args.client, diff --git a/scripts/rpc/nvmf.py b/scripts/rpc/nvmf.py index 9233b8a28c..682c13e9d2 100644 --- a/scripts/rpc/nvmf.py +++ b/scripts/rpc/nvmf.py @@ -1,3 +1,6 @@ +from .helpers import deprecated_alias + + def set_nvmf_target_max_subsystems(client, max_subsystems=None): """Set NVMe-oF target options. @@ -159,7 +162,8 @@ def get_nvmf_transports(client, tgt_name=None): return client.call('get_nvmf_transports', params) -def get_nvmf_subsystems(client, tgt_name=None): +@deprecated_alias('get_nvmf_subsystems') +def nvmf_get_subsystems(client, tgt_name=None): """Get list of NVMe-oF subsystems. Args: tgt_name: name of the parent NVMe-oF target (optional). @@ -175,7 +179,7 @@ def get_nvmf_subsystems(client, tgt_name=None): 'tgt_name': tgt_name, } - return client.call('get_nvmf_subsystems', params) + return client.call('nvmf_get_subsystems', params) def nvmf_subsystem_create(client, diff --git a/scripts/spdkcli/ui_node_nvmf.py b/scripts/spdkcli/ui_node_nvmf.py index 7f31b74977..360cf56aea 100644 --- a/scripts/spdkcli/ui_node_nvmf.py +++ b/scripts/spdkcli/ui_node_nvmf.py @@ -68,7 +68,7 @@ class UINVMfSubsystems(UINode): def refresh(self): self._children = set([]) - for subsystem in self.get_root().get_nvmf_subsystems(): + for subsystem in self.get_root().nvmf_get_subsystems(): UINVMfSubsystem(subsystem, self) def delete(self, subsystem_nqn): @@ -129,7 +129,7 @@ class UINVMfSubsystem(UINode): UINVMfSubsystemNamespaces(self.subsystem.namespaces, self) def refresh_node(self): - for subsystem in self.get_root().get_nvmf_subsystems(): + for subsystem in self.get_root().nvmf_get_subsystems(): if subsystem.nqn == self.subsystem.nqn: self.subsystem = subsystem self.refresh() @@ -173,7 +173,7 @@ class UINVMfSubsystemListeners(UINode): UINVMfSubsystemListener(address, self) def refresh_node(self): - for subsystem in self.get_root().get_nvmf_subsystems(): + for subsystem in self.get_root().nvmf_get_subsystems(): if subsystem.nqn == self.parent.subsystem.nqn: self.listen_addresses = subsystem.listen_addresses self.refresh() @@ -244,7 +244,7 @@ class UINVMfSubsystemHosts(UINode): UINVMfSubsystemHost(host, self) def refresh_node(self): - for subsystem in self.get_root().get_nvmf_subsystems(): + for subsystem in self.get_root().nvmf_get_subsystems(): if subsystem.nqn == self.parent.subsystem.nqn: self.hosts = subsystem.hosts self.refresh() @@ -303,7 +303,7 @@ class UINVMfSubsystemNamespaces(UINode): UINVMfSubsystemNamespace(namespace, self) def refresh_node(self): - for subsystem in self.get_root().get_nvmf_subsystems(): + for subsystem in self.get_root().nvmf_get_subsystems(): if subsystem.nqn == self.parent.subsystem.nqn: self.namespaces = subsystem.namespaces self.refresh() diff --git a/scripts/spdkcli/ui_root.py b/scripts/spdkcli/ui_root.py index bd63e6e073..7d41ad71ff 100644 --- a/scripts/spdkcli/ui_root.py +++ b/scripts/spdkcli/ui_root.py @@ -318,11 +318,11 @@ class UIRoot(UINode): def list_nvmf_subsystems(self): if self.is_init: - self.current_nvmf_subsystems = rpc.nvmf.get_nvmf_subsystems(self.client) + self.current_nvmf_subsystems = rpc.nvmf.nvmf_get_subsystems(self.client) @verbose @is_method_available - def get_nvmf_subsystems(self): + def nvmf_get_subsystems(self): if self.is_init: self.list_nvmf_subsystems() for subsystem in self.current_nvmf_subsystems: diff --git a/test/nvmf/host/aer.sh b/test/nvmf/host/aer.sh index 7e8670b0b1..2962be40f2 100755 --- a/test/nvmf/host/aer.sh +++ b/test/nvmf/host/aer.sh @@ -18,7 +18,7 @@ $rpc_py nvmf_subsystem_create nqn.2016-06.io.spdk:cnode1 -a -s SPDK0000000000000 $rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode1 Malloc0 $rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT -$rpc_py get_nvmf_subsystems +$rpc_py nvmf_get_subsystems AER_TOUCH_FILE=/tmp/aer_touch_file rm -f $AER_TOUCH_FILE @@ -38,7 +38,7 @@ waitforfile $AER_TOUCH_FILE # Add a new namespace $rpc_py bdev_malloc_create 64 4096 --name Malloc1 $rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode1 Malloc1 -n 2 -$rpc_py get_nvmf_subsystems +$rpc_py nvmf_get_subsystems wait $aerpid diff --git a/test/nvmf/host/identify.sh b/test/nvmf/host/identify.sh index 28fd0d22ba..dcd3429ada 100755 --- a/test/nvmf/host/identify.sh +++ b/test/nvmf/host/identify.sh @@ -33,7 +33,7 @@ $rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode1 Malloc0 \ --eui64 "ABCDEF0123456789" $rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT -$rpc_py get_nvmf_subsystems +$rpc_py nvmf_get_subsystems $rootdir/examples/nvme/identify/identify -r "\ trtype:$TEST_TRANSPORT \ diff --git a/test/nvmf/target/create_transport.sh b/test/nvmf/target/create_transport.sh index 419089c5f9..6d20a8d2f0 100755 --- a/test/nvmf/target/create_transport.sh +++ b/test/nvmf/target/create_transport.sh @@ -34,7 +34,7 @@ $rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t $TEST_TRANSPOR nvme discover -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT echo "Perform nvmf subsystem discovery via RPC" -$rpc_py get_nvmf_subsystems +$rpc_py nvmf_get_subsystems $rpc_py delete_nvmf_subsystem nqn.2016-06.io.spdk:cnode1 diff --git a/test/nvmf/target/discovery.sh b/test/nvmf/target/discovery.sh index 7ea369e678..e15afc26d3 100755 --- a/test/nvmf/target/discovery.sh +++ b/test/nvmf/target/discovery.sh @@ -32,7 +32,7 @@ done nvme discover -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT echo "Perform nvmf subsystem discovery via RPC" -$rpc_py get_nvmf_subsystems +$rpc_py nvmf_get_subsystems for i in $(seq 1 4); do $rpc_py delete_nvmf_subsystem nqn.2016-06.io.spdk:cnode$i