RPC: rename get_subsystems to framework_get_subsystems

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Iaeaf20e2a16b41796cb89a92fadd99cb1d341720
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468670
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
This commit is contained in:
Maciej Wawryk 2019-09-18 10:24:58 +02:00 committed by Jim Harris
parent 7630daa204
commit 8710b60062
7 changed files with 22 additions and 16 deletions

View File

@ -276,7 +276,7 @@ Example response:
"bdev_get_bdevs",
"bdev_get_iostat",
"get_subsystem_config",
"get_subsystems",
"framework_get_subsystems",
"framework_monitor_context_switch",
"spdk_kill_instance",
"ioat_scan_copy_engine",
@ -317,7 +317,7 @@ Example response:
}
~~~
## get_subsystems {#rpc_get_subsystems}
## framework_get_subsystems {#rpc_framework_get_subsystems}
Get an array of name and dependency relationship of SPDK subsystems in initialization order.
@ -337,7 +337,7 @@ Example request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get_subsystems"
"method": "framework_get_subsystems"
}
~~~

View File

@ -38,8 +38,8 @@
#include "spdk/env.h"
static void
spdk_rpc_get_subsystems(struct spdk_jsonrpc_request *request,
const struct spdk_json_val *params)
spdk_rpc_framework_get_subsystems(struct spdk_jsonrpc_request *request,
const struct spdk_json_val *params)
{
struct spdk_json_write_ctx *w;
struct spdk_subsystem *subsystem;
@ -47,7 +47,7 @@ spdk_rpc_get_subsystems(struct spdk_jsonrpc_request *request,
if (params) {
spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS,
"'get_subsystems' requires no arguments");
"'framework_get_subsystems' requires no arguments");
return;
}
@ -71,7 +71,8 @@ spdk_rpc_get_subsystems(struct spdk_jsonrpc_request *request,
spdk_jsonrpc_end_result(request, w);
}
SPDK_RPC_REGISTER("get_subsystems", spdk_rpc_get_subsystems, SPDK_RPC_RUNTIME)
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 {
char *name;

View File

@ -1828,12 +1828,13 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse
p.set_defaults(func=bdev_pmem_delete_pool)
# subsystem
def get_subsystems(args):
print_dict(rpc.subsystem.get_subsystems(args.client))
def framework_get_subsystems(args):
print_dict(rpc.subsystem.framework_get_subsystems(args.client))
p = subparsers.add_parser('get_subsystems', help="""Print subsystems array in initialization order. Each subsystem
p = subparsers.add_parser('framework_get_subsystems', aliases=['get_subsystems'],
help="""Print subsystems array in initialization order. Each subsystem
entry contain (unsorted) array of subsystems it depends on.""")
p.set_defaults(func=get_subsystems)
p.set_defaults(func=framework_get_subsystems)
def get_subsystem_config(args):
print_dict(rpc.subsystem.get_subsystem_config(args.client, args.name))

View File

@ -76,7 +76,7 @@ def save_config(client, fd, indent=2):
'subsystems': []
}
for elem in client.call('get_subsystems'):
for elem in client.call('framework_get_subsystems'):
cfg = {
'subsystem': elem['subsystem'],
'config': client.call('get_subsystem_config', {"name": elem['subsystem']})

View File

@ -1,5 +1,9 @@
def get_subsystems(client):
return client.call('get_subsystems')
from .helpers import deprecated_alias
@deprecated_alias('get_subsystems')
def framework_get_subsystems(client):
return client.call('framework_get_subsystems')
def get_subsystem_config(client, name):

View File

@ -482,7 +482,7 @@ class UIRoot(UINode):
return rpc.iscsi.iscsi_get_options(self.client, **kwargs)
def has_subsystem(self, subsystem):
for system in rpc.subsystem.get_subsystems(self.client):
for system in rpc.subsystem.framework_get_subsystems(self.client):
if subsystem.lower() == system["subsystem"].lower():
return True
return False

View File

@ -176,7 +176,7 @@ if __name__ == "__main__":
@call_test_cmd
def clear_config(args):
for subsystem_item in reversed(args.client.call('get_subsystems')):
for subsystem_item in reversed(args.client.call('framework_get_subsystems')):
args.subsystem = subsystem_item['subsystem']
clear_subsystem(args)