diff --git a/doc/jsonrpc.md b/doc/jsonrpc.md index 8c9a970e1c..39479376e4 100644 --- a/doc/jsonrpc.md +++ b/doc/jsonrpc.md @@ -249,7 +249,7 @@ Example response: "nbd_start_disk", "get_log_flags", "clear_log_flag", - "set_log_flag", + "log_set_flag", "log_get_level", "log_set_level", "log_get_print_level", diff --git a/lib/log/log_flags.c b/lib/log/log_flags.c index a8cbae9d77..75848b2104 100644 --- a/lib/log/log_flags.c +++ b/lib/log/log_flags.c @@ -138,7 +138,7 @@ spdk_log_get_flag(const char *name) } static int -set_log_flag(const char *name, bool value) +log_set_flag(const char *name, bool value) { struct spdk_log_flag *flag; @@ -162,13 +162,13 @@ set_log_flag(const char *name, bool value) int spdk_log_set_flag(const char *name) { - return set_log_flag(name, true); + return log_set_flag(name, true); } int spdk_log_clear_flag(const char *name) { - return set_log_flag(name, false); + return log_set_flag(name, false); } struct spdk_log_flag * diff --git a/lib/log_rpc/log_rpc.c b/lib/log_rpc/log_rpc.c index 68a29dadb8..2faad9d754 100644 --- a/lib/log_rpc/log_rpc.c +++ b/lib/log_rpc/log_rpc.c @@ -238,7 +238,7 @@ SPDK_RPC_REGISTER("log_get_level", spdk_rpc_log_get_level, SPDK_RPC_STARTUP | SP SPDK_RPC_REGISTER_ALIAS_DEPRECATED(log_get_level, get_log_level) static void -spdk_rpc_set_log_flag(struct spdk_jsonrpc_request *request, +spdk_rpc_log_set_flag(struct spdk_jsonrpc_request *request, const struct spdk_json_val *params) { struct rpc_log_flag req = {}; @@ -270,8 +270,8 @@ spdk_rpc_set_log_flag(struct spdk_jsonrpc_request *request, invalid: free_rpc_log_flag(&req); } -SPDK_RPC_REGISTER("set_log_flag", spdk_rpc_set_log_flag, SPDK_RPC_STARTUP | SPDK_RPC_RUNTIME) -SPDK_RPC_REGISTER_ALIAS_DEPRECATED(set_log_flag, set_trace_flag) +SPDK_RPC_REGISTER("log_set_flag", spdk_rpc_log_set_flag, SPDK_RPC_STARTUP | SPDK_RPC_RUNTIME) +SPDK_RPC_REGISTER_ALIAS_DEPRECATED(log_set_flag, set_log_flag) static void spdk_rpc_clear_log_flag(struct spdk_jsonrpc_request *request, diff --git a/scripts/rpc.py b/scripts/rpc.py index a5b0fe0846..7c46f6ce60 100755 --- a/scripts/rpc.py +++ b/scripts/rpc.py @@ -1125,13 +1125,13 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse p.set_defaults(func=get_tpoint_group_mask) # log - def set_log_flag(args): - rpc.log.set_log_flag(args.client, flag=args.flag) + def log_set_flag(args): + rpc.log.log_set_flag(args.client, flag=args.flag) - p = subparsers.add_parser('set_log_flag', help='set log flag', aliases=['set_trace_flag']) + p = subparsers.add_parser('log_set_flag', help='set log flag', aliases=['set_log_flag']) p.add_argument( 'flag', help='log flag we want to set. (for example "nvme").') - p.set_defaults(func=set_log_flag) + p.set_defaults(func=log_set_flag) def clear_log_flag(args): rpc.log.clear_log_flag(args.client, flag=args.flag) diff --git a/scripts/rpc/log.py b/scripts/rpc/log.py index 04744a688b..35f96f18bd 100644 --- a/scripts/rpc/log.py +++ b/scripts/rpc/log.py @@ -1,15 +1,15 @@ from .helpers import deprecated_alias -@deprecated_alias('set_trace_flag') -def set_log_flag(client, flag): +@deprecated_alias('set_log_flag') +def log_set_flag(client, flag): """Set log flag. Args: flag: log flag we want to set. (for example "nvme") """ params = {'flag': flag} - return client.call('set_log_flag', params) + return client.call('log_set_flag', params) @deprecated_alias('clear_trace_flag') diff --git a/test/iscsi_tgt/rpc_config/rpc_config.py b/test/iscsi_tgt/rpc_config/rpc_config.py index aa531d9419..04ffe5f0e6 100755 --- a/test/iscsi_tgt/rpc_config/rpc_config.py +++ b/test/iscsi_tgt/rpc_config/rpc_config.py @@ -80,7 +80,7 @@ def verify_log_flag_rpc_methods(rpc_py, rpc_param): jsonvalue = json.loads(output) verify(not jsonvalue[rpc_param['log_flag']], 1, "get_log_flags returned {}, expected false".format(jsonvalue)) - rpc.set_log_flag(rpc_param['log_flag']) + rpc.log_set_flag(rpc_param['log_flag']) output = rpc.get_log_flags() jsonvalue = json.loads(output) verify(jsonvalue[rpc_param['log_flag']], 1,