virtio/rpc: fix construct_virtio_user_scsi_bdev
argument 'name' was added as optional but it was requiered to create new virtio device, causing incorrect parsing of arguments. Also, there were missing names in output when creating multitarget device Change-Id: I3a3b68fd91c3aecbe94f91d95299d042b1dec7b8 Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com> Reviewed-on: https://review.gerrithub.io/390805 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
7c13831f39
commit
f84443572b
@ -89,7 +89,6 @@ rpc_create_virtio_user_scsi_bdev_cb(void *ctx, int result, struct spdk_bdev **bd
|
||||
|
||||
for (i = 0; i < cnt; i++) {
|
||||
spdk_json_write_string(w, spdk_bdev_get_name(bdevs[i]));
|
||||
bdevs++;
|
||||
}
|
||||
|
||||
spdk_json_write_array_end(w);
|
||||
|
@ -807,7 +807,10 @@ p.add_argument('ctrlr', help='controller name')
|
||||
p.set_defaults(func=remove_vhost_controller)
|
||||
|
||||
def construct_virtio_user_scsi_bdev(args):
|
||||
params = {'path': args.path}
|
||||
params = {
|
||||
'path': args.path,
|
||||
'name': args.name,
|
||||
}
|
||||
if args.vq_count:
|
||||
params['vq_count'] = args.vq_count
|
||||
if args.vq_size:
|
||||
@ -818,8 +821,8 @@ p = subparsers.add_parser('construct_virtio_user_scsi_bdev', help="""Connect to
|
||||
This imply scan and add bdevs offered by remote side.
|
||||
Result is array of added bdevs.""")
|
||||
p.add_argument('path', help='Path to Virtio SCSI socket')
|
||||
p.add_argument('-b', '--name', help="""Use this name as base instead of 'VirtioScsiN'
|
||||
Base will be used to construct new bdev's found on target by adding 't<TARGET_ID>' sufix.""", required=True)
|
||||
p.add_argument('name', help="""Use this name as base instead of 'VirtioScsiN'
|
||||
Base will be used to construct new bdev's found on target by adding 't<TARGET_ID>' sufix.""")
|
||||
p.add_argument('--vq-count', help='Number of virtual queues to be used.', type=int)
|
||||
p.add_argument('--vq-size', help='Size of each queue', type=int)
|
||||
p.set_defaults(func=construct_virtio_user_scsi_bdev)
|
||||
|
Loading…
Reference in New Issue
Block a user