rpc: Rename construct_vhost_nvme_controller to vhost_create_nvme_controller

Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Change-Id: I3237352097cd78679ef95c519f970693a15c0c50
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470395
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Pawel Kaminski 2019-10-03 20:58:51 +00:00 committed by Tomasz Zawadzki
parent 119e911a0a
commit ca731a6a55
10 changed files with 25 additions and 22 deletions

View File

@ -4502,7 +4502,7 @@ Example response:
}
~~~
## construct_vhost_nvme_controller {#rpc_construct_vhost_nvme_controller}
## vhost_create_nvme_controller {#rpc_vhost_create_nvme_controller}
Construct empty vhost NVMe controller.
@ -4527,7 +4527,7 @@ Example request:
"ctrlr": "VhostNvme0"
},
"jsonrpc": "2.0",
"method": "construct_vhost_nvme_controller",
"method": "vhost_create_nvme_controller",
"id": 1
}
~~~

View File

@ -180,7 +180,7 @@ controller. Users must specify the maximum I/O queues supported for the
controller, at least 1 Namespace is required for each controller.
~~~{.sh}
$rpc_py construct_vhost_nvme_controller --cpumask 0x1 vhost.2 16
$rpc_py vhost_create_nvme_controller --cpumask 0x1 vhost.2 16
$rpc_py add_vhost_nvme_ns vhost.2 Malloc0
~~~

View File

@ -1252,7 +1252,7 @@ spdk_vhost_nvme_write_config_json(struct spdk_vhost_dev *vdev, struct spdk_json_
}
spdk_json_write_object_begin(w);
spdk_json_write_named_string(w, "method", "construct_vhost_nvme_controller");
spdk_json_write_named_string(w, "method", "vhost_create_nvme_controller");
spdk_json_write_named_object_begin(w, "params");
spdk_json_write_named_string(w, "ctrlr", nvme->vdev.name);

View File

@ -542,8 +542,8 @@ free_rpc_vhost_nvme_ctrlr(struct rpc_vhost_nvme_ctrlr *req)
}
static void
spdk_rpc_construct_vhost_nvme_controller(struct spdk_jsonrpc_request *request,
const struct spdk_json_val *params)
spdk_rpc_vhost_create_nvme_controller(struct spdk_jsonrpc_request *request,
const struct spdk_json_val *params)
{
struct rpc_vhost_nvme_ctrlr req = {};
struct spdk_json_write_ctx *w;
@ -574,8 +574,9 @@ invalid:
spdk_strerror(-rc));
}
SPDK_RPC_REGISTER("construct_vhost_nvme_controller", spdk_rpc_construct_vhost_nvme_controller,
SPDK_RPC_REGISTER("vhost_create_nvme_controller", spdk_rpc_vhost_create_nvme_controller,
SPDK_RPC_RUNTIME)
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(vhost_create_nvme_controller, construct_vhost_nvme_controller)
struct rpc_add_vhost_nvme_ctrlr_ns {
char *ctrlr;

View File

@ -20,7 +20,7 @@ bdev_dict["bdev_virtio_attach_controller"] = []
vhost_dict = OrderedDict()
vhost_dict["vhost_create_scsi_controller"] = []
vhost_dict["construct_vhost_blk_controller"] = []
vhost_dict["construct_vhost_nvme_controller"] = []
vhost_dict["vhost_create_nvme_controller"] = []
iscsi_dict = OrderedDict()
iscsi_dict["iscsi_set_options"] = []
@ -452,7 +452,7 @@ def get_vhost_nvme_json(config, section):
vhost_nvme_json = []
vhost_nvme_json.append({
"params": to_json_params(params[:3]),
"method": "construct_vhost_nvme_controller"
"method": "vhost_create_nvme_controller"
})
for namespace in params[3][3]:
vhost_nvme_json.append({
@ -705,7 +705,7 @@ if __name__ == "__main__":
if match_section == "VhostScsi":
section_to_subsystem[match_section]["vhost_create_scsi_controller"].append(item)
elif match_section == "VhostNvme":
section_to_subsystem[match_section]["construct_vhost_nvme_controller"].append(item)
section_to_subsystem[match_section]["vhost_create_nvme_controller"].append(item)
elif match_section == "Subsystem":
section_to_subsystem[match_section]["subsystems"].append(item)
else:

View File

@ -1914,17 +1914,18 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse
p.add_argument("-r", "--readonly", action='store_true', help='Set controller as read-only')
p.set_defaults(func=construct_vhost_blk_controller)
def construct_vhost_nvme_controller(args):
rpc.vhost.construct_vhost_nvme_controller(args.client,
ctrlr=args.ctrlr,
io_queues=args.io_queues,
cpumask=args.cpumask)
def vhost_create_nvme_controller(args):
rpc.vhost.vhost_create_nvme_controller(args.client,
ctrlr=args.ctrlr,
io_queues=args.io_queues,
cpumask=args.cpumask)
p = subparsers.add_parser('construct_vhost_nvme_controller', help='Add new vhost controller')
p = subparsers.add_parser('vhost_create_nvme_controller', aliases=['vhost_create_nvme_controller'],
help='Add new vhost controller')
p.add_argument('ctrlr', help='controller name')
p.add_argument('io_queues', help='number of IO queues for the controller', type=int)
p.add_argument('--cpumask', help='cpu mask for this controller')
p.set_defaults(func=construct_vhost_nvme_controller)
p.set_defaults(func=vhost_create_nvme_controller)
def add_vhost_nvme_ns(args):
rpc.vhost.add_vhost_nvme_ns(args.client,

View File

@ -62,7 +62,8 @@ def vhost_scsi_controller_remove_target(client, ctrlr, scsi_target_num):
return client.call('vhost_scsi_controller_remove_target', params)
def construct_vhost_nvme_controller(client, ctrlr, io_queues, cpumask=None):
@deprecated_alias('construct_vhost_nvme_controller')
def vhost_create_nvme_controller(client, ctrlr, io_queues, cpumask=None):
"""Construct vhost NVMe controller.
Args:
ctrlr: controller name
@ -77,7 +78,7 @@ def construct_vhost_nvme_controller(client, ctrlr, io_queues, cpumask=None):
if cpumask:
params['cpumask'] = cpumask
return client.call('construct_vhost_nvme_controller', params)
return client.call('vhost_create_nvme_controller', params)
def add_vhost_nvme_ns(client, ctrlr, bdev_name):

View File

@ -383,7 +383,7 @@
"io_queues": 2,
"ctrlr": "naa.vhost.3"
},
"method": "construct_vhost_nvme_controller"
"method": "vhost_create_nvme_controller"
},
{
"params": {

View File

@ -149,7 +149,7 @@ def clear_vhost_subsystem(args, vhost_config):
{"ctrlr": vhost['params']['ctrlr'],
"scsi_target_num": vhost['params']['scsi_target_num']})
elif method in ['vhost_create_scsi_controller', 'construct_vhost_blk_controller',
'construct_vhost_nvme_controller']:
'vhost_create_nvme_controller']:
args.client.call("vhost_delete_controller", {'ctrlr': vhost['params']['ctrlr']})

View File

@ -289,7 +289,7 @@ function create_vhost_subsystem_config() {
tgt_rpc construct_vhost_blk_controller VhostBlkCtrlr0 MallocForVhost0p5
# FIXME: enable after vhost-nvme is properly implemented against the latest rte_vhost (DPDK 19.05+)
# tgt_rpc construct_vhost_nvme_controller VhostNvmeCtrlr0 16
# tgt_rpc vhost_create_nvme_controller VhostNvmeCtrlr0 16
# tgt_rpc add_vhost_nvme_ns VhostNvmeCtrlr0 MallocForVhost0p6
timing_exit $FUNCNAME