rpc: Rename set_bdev_nvme_hotplug to bdev_nvme_set_hotplug.
Change-Id: Iad39a30aab1edcaa03b748249d6b9f94a95822f8 Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/466050 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
parent
eb401ec12e
commit
61a42c0e64
@ -1440,7 +1440,7 @@ Example response:
|
||||
}
|
||||
~~~
|
||||
|
||||
## set_bdev_nvme_hotplug {#rpc_set_bdev_nvme_hotplug}
|
||||
## bdev_nvme_set_hotplug {#rpc_bdev_nvme_set_hotplug}
|
||||
|
||||
Change settings of the NVMe hotplug feature. If enabled, PCIe NVMe bdevs will be automatically discovered on insertion
|
||||
and deleted on removal.
|
||||
@ -1464,7 +1464,7 @@ request:
|
||||
"period_us": 2000
|
||||
},
|
||||
"jsonrpc": "2.0",
|
||||
"method": "set_bdev_nvme_hotplug",
|
||||
"method": "bdev_nvme_set_hotplug",
|
||||
"id": 1
|
||||
}
|
||||
~~~
|
||||
|
@ -2140,7 +2140,7 @@ bdev_nvme_config_json(struct spdk_json_write_ctx *w)
|
||||
* before enabling hotplug poller.
|
||||
*/
|
||||
spdk_json_write_object_begin(w);
|
||||
spdk_json_write_named_string(w, "method", "set_bdev_nvme_hotplug");
|
||||
spdk_json_write_named_string(w, "method", "bdev_nvme_set_hotplug");
|
||||
|
||||
spdk_json_write_named_object_begin(w, "params");
|
||||
spdk_json_write_named_uint64(w, "period_us", g_nvme_hotplug_poll_period_us);
|
||||
|
@ -122,7 +122,7 @@ static const struct spdk_json_object_decoder rpc_bdev_nvme_hotplug_decoders[] =
|
||||
};
|
||||
|
||||
static void
|
||||
rpc_set_bdev_nvme_hotplug_done(void *ctx)
|
||||
rpc_bdev_nvme_set_hotplug_done(void *ctx)
|
||||
{
|
||||
struct spdk_jsonrpc_request *request = ctx;
|
||||
struct spdk_json_write_ctx *w = spdk_jsonrpc_begin_result(request);
|
||||
@ -132,7 +132,7 @@ rpc_set_bdev_nvme_hotplug_done(void *ctx)
|
||||
}
|
||||
|
||||
static void
|
||||
spdk_rpc_set_bdev_nvme_hotplug(struct spdk_jsonrpc_request *request,
|
||||
spdk_rpc_bdev_nvme_set_hotplug(struct spdk_jsonrpc_request *request,
|
||||
const struct spdk_json_val *params)
|
||||
{
|
||||
struct rpc_bdev_nvme_hotplug req = {false, 0};
|
||||
@ -145,7 +145,7 @@ spdk_rpc_set_bdev_nvme_hotplug(struct spdk_jsonrpc_request *request,
|
||||
goto invalid;
|
||||
}
|
||||
|
||||
rc = spdk_bdev_nvme_set_hotplug(req.enabled, req.period_us, rpc_set_bdev_nvme_hotplug_done,
|
||||
rc = spdk_bdev_nvme_set_hotplug(req.enabled, req.period_us, rpc_bdev_nvme_set_hotplug_done,
|
||||
request);
|
||||
if (rc) {
|
||||
goto invalid;
|
||||
@ -155,7 +155,8 @@ spdk_rpc_set_bdev_nvme_hotplug(struct spdk_jsonrpc_request *request,
|
||||
invalid:
|
||||
spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS, spdk_strerror(-rc));
|
||||
}
|
||||
SPDK_RPC_REGISTER("set_bdev_nvme_hotplug", spdk_rpc_set_bdev_nvme_hotplug, SPDK_RPC_RUNTIME)
|
||||
SPDK_RPC_REGISTER("bdev_nvme_set_hotplug", spdk_rpc_bdev_nvme_set_hotplug, SPDK_RPC_RUNTIME)
|
||||
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(set_bdev_nvme_hotplug, bdev_nvme_set_hotplug)
|
||||
|
||||
struct rpc_construct_nvme {
|
||||
char *name;
|
||||
|
@ -11,7 +11,7 @@ bdev_dict["set_bdev_options"] = []
|
||||
bdev_dict["construct_split_vbdev"] = []
|
||||
bdev_dict["bdev_nvme_set_options"] = []
|
||||
bdev_dict["construct_nvme_bdev"] = []
|
||||
bdev_dict["set_bdev_nvme_hotplug"] = []
|
||||
bdev_dict["bdev_nvme_set_hotplug"] = []
|
||||
bdev_dict["bdev_malloc_create"] = []
|
||||
bdev_dict["bdev_aio_create"] = []
|
||||
bdev_dict["construct_pmem_bdev"] = []
|
||||
@ -238,7 +238,7 @@ def get_nvme_bdev_json(config, section):
|
||||
params[6][3] = params[6][3] * 100
|
||||
nvme_json.append({
|
||||
"params": to_json_params(params[5:7]),
|
||||
"method": "set_bdev_nvme_hotplug"
|
||||
"method": "bdev_nvme_set_hotplug"
|
||||
})
|
||||
nvme_json.append({
|
||||
"params": to_json_params(params[0:5]),
|
||||
|
@ -343,16 +343,16 @@ if __name__ == "__main__":
|
||||
help='The number of requests allocated for each NVMe I/O queue. Default: 512', type=int)
|
||||
p.set_defaults(func=bdev_nvme_set_options)
|
||||
|
||||
def set_bdev_nvme_hotplug(args):
|
||||
rpc.bdev.set_bdev_nvme_hotplug(args.client, enable=args.enable, period_us=args.period_us)
|
||||
def bdev_nvme_set_hotplug(args):
|
||||
rpc.bdev.bdev_nvme_set_hotplug(args.client, enable=args.enable, period_us=args.period_us)
|
||||
|
||||
p = subparsers.add_parser('set_bdev_nvme_hotplug',
|
||||
p = subparsers.add_parser('bdev_nvme_set_hotplug', aliases=['set_bdev_nvme_hotplug'],
|
||||
help='Set hotplug options for bdev nvme type.')
|
||||
p.add_argument('-d', '--disable', dest='enable', default=False, action='store_false', help="Disable hotplug (default)")
|
||||
p.add_argument('-e', '--enable', dest='enable', action='store_true', help="Enable hotplug")
|
||||
p.add_argument('-r', '--period-us',
|
||||
help='How often the hotplug is processed for insert and remove events', type=int)
|
||||
p.set_defaults(func=set_bdev_nvme_hotplug)
|
||||
p.set_defaults(func=bdev_nvme_set_hotplug)
|
||||
|
||||
def construct_nvme_bdev(args):
|
||||
print_array(rpc.bdev.construct_nvme_bdev(args.client,
|
||||
|
@ -352,7 +352,8 @@ def bdev_nvme_set_options(client, action_on_timeout=None, timeout_us=None, retry
|
||||
return client.call('bdev_nvme_set_options', params)
|
||||
|
||||
|
||||
def set_bdev_nvme_hotplug(client, enable, period_us=None):
|
||||
@deprecated_alias('bdev_nvme_set_hotplug')
|
||||
def bdev_nvme_set_hotplug(client, enable, period_us=None):
|
||||
"""Set options for the bdev nvme. This is startup command.
|
||||
|
||||
Args:
|
||||
@ -364,7 +365,7 @@ def set_bdev_nvme_hotplug(client, enable, period_us=None):
|
||||
if period_us:
|
||||
params['period_us'] = period_us
|
||||
|
||||
return client.call('set_bdev_nvme_hotplug', params)
|
||||
return client.call('bdev_nvme_set_hotplug', params)
|
||||
|
||||
|
||||
def construct_nvme_bdev(client, name, trtype, traddr, adrfam=None, trsvcid=None,
|
||||
|
@ -53,7 +53,7 @@
|
||||
"enable": true,
|
||||
"period_us": 10000000
|
||||
},
|
||||
"method": "set_bdev_nvme_hotplug"
|
||||
"method": "bdev_nvme_set_hotplug"
|
||||
},
|
||||
{
|
||||
"params": {
|
||||
|
@ -37,7 +37,7 @@
|
||||
"enable": false,
|
||||
"period_us": 100000
|
||||
},
|
||||
"method": "set_bdev_nvme_hotplug"
|
||||
"method": "bdev_nvme_set_hotplug"
|
||||
},
|
||||
{
|
||||
"params": {
|
||||
|
@ -67,7 +67,7 @@ def clear_bdev_subsystem(args, bdev_config):
|
||||
args.client.call('delete_nvme_controller', {'name': ctrlr['name']})
|
||||
|
||||
''' Disable and reset hotplug '''
|
||||
rpc.bdev.set_bdev_nvme_hotplug(args.client, False)
|
||||
rpc.bdev.bdev_nvme_set_hotplug(args.client, False)
|
||||
|
||||
|
||||
def get_nvmf_destroy_method(nvmf):
|
||||
|
@ -29,7 +29,7 @@ def filter_methods(do_remove_global_rpcs):
|
||||
'nvmf_create_transport',
|
||||
'set_bdev_options',
|
||||
'bdev_nvme_set_options',
|
||||
'set_bdev_nvme_hotplug',
|
||||
'bdev_nvme_set_hotplug',
|
||||
]
|
||||
|
||||
data = json.loads(sys.stdin.read())
|
||||
|
@ -23,7 +23,7 @@ $rootdir/scripts/gen_nvme.sh >> $testdir/conf.json
|
||||
$rootdir/app/spdk_tgt/spdk_tgt -m 0x3 -p 0 -s 1024 -c $testdir/conf.json &
|
||||
nvmfpid=$!
|
||||
waitforlisten $nvmfpid
|
||||
$rpc_py set_bdev_nvme_hotplug -e
|
||||
$rpc_py bdev_nvme_set_hotplug -e
|
||||
timing_exit run_spdk_tgt
|
||||
|
||||
timing_enter run_rpc_proxy
|
||||
|
@ -62,7 +62,7 @@ notice ""
|
||||
notice "running SPDK"
|
||||
notice ""
|
||||
vhost_run 0
|
||||
$rpc_py set_bdev_nvme_hotplug -e
|
||||
$rpc_py bdev_nvme_set_hotplug -e
|
||||
$rpc_py construct_split_vbdev Nvme0n1 16
|
||||
$rpc_py bdev_malloc_create 128 512 -b Malloc
|
||||
$rpc_py construct_split_vbdev Malloc 4
|
||||
|
@ -51,7 +51,7 @@ dd if=/dev/zero of=$aio_file bs=1M count=512
|
||||
|
||||
timing_enter vhost_run
|
||||
vhost_run 0
|
||||
$rpc_py set_bdev_nvme_hotplug -e
|
||||
$rpc_py bdev_nvme_set_hotplug -e
|
||||
$rpc_py bdev_malloc_create 256 4096 -b Malloc0
|
||||
$rpc_py bdev_aio_create $aio_file Aio0 512
|
||||
$rpc_py get_bdevs
|
||||
|
Loading…
Reference in New Issue
Block a user