RPC: rename set_log_flag to log_set_flag

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I5949af4a9bc9b01aa357246b93a03efd0e425060
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468720
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Maciej Wawryk 2019-09-18 14:21:59 +02:00 committed by Jim Harris
parent ba735b4221
commit 8dc50d2d32
6 changed files with 15 additions and 15 deletions

View File

@ -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",

View File

@ -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 *

View File

@ -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,

View File

@ -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)

View File

@ -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')

View File

@ -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,