rpc: pass params as **kwargs in vhost_create_blk_controller
This will make it possible for out-of-tree virtio-blk transports to pass transport-specific options when creating controllers. Change-Id: I862f0f8096aadb5e47bbe4c1c418aaf06691e1ac Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12818 Community-CI: Mellanox Build Bot Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
e661c8e824
commit
5ab0f37fe6
@ -70,8 +70,7 @@ def vhost_scsi_controller_remove_target(client, ctrlr, scsi_target_num):
|
|||||||
return client.call('vhost_scsi_controller_remove_target', params)
|
return client.call('vhost_scsi_controller_remove_target', params)
|
||||||
|
|
||||||
|
|
||||||
def vhost_create_blk_controller(
|
def vhost_create_blk_controller(client, **params):
|
||||||
client, ctrlr, dev_name, cpumask=None, transport=None, readonly=None, packed_ring=None, packed_ring_recovery=None):
|
|
||||||
"""Create vhost BLK controller.
|
"""Create vhost BLK controller.
|
||||||
Args:
|
Args:
|
||||||
ctrlr: controller name
|
ctrlr: controller name
|
||||||
@ -82,20 +81,9 @@ def vhost_create_blk_controller(
|
|||||||
packed_ring: support controller packed_ring
|
packed_ring: support controller packed_ring
|
||||||
packed_ring_recovery: enable packed ring live recovery
|
packed_ring_recovery: enable packed ring live recovery
|
||||||
"""
|
"""
|
||||||
params = {
|
strip_globals(params)
|
||||||
'ctrlr': ctrlr,
|
remove_null(params)
|
||||||
'dev_name': dev_name,
|
|
||||||
}
|
|
||||||
if cpumask:
|
|
||||||
params['cpumask'] = cpumask
|
|
||||||
if transport:
|
|
||||||
params['transport'] = transport
|
|
||||||
if readonly:
|
|
||||||
params['readonly'] = readonly
|
|
||||||
if packed_ring:
|
|
||||||
params['packed_ring'] = packed_ring
|
|
||||||
if packed_ring_recovery:
|
|
||||||
params['packed_ring_recovery'] = packed_ring_recovery
|
|
||||||
return client.call('vhost_create_blk_controller', params)
|
return client.call('vhost_create_blk_controller', params)
|
||||||
|
|
||||||
|
|
||||||
|
@ -2453,14 +2453,7 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse
|
|||||||
p.set_defaults(func=vhost_scsi_controller_remove_target)
|
p.set_defaults(func=vhost_scsi_controller_remove_target)
|
||||||
|
|
||||||
def vhost_create_blk_controller(args):
|
def vhost_create_blk_controller(args):
|
||||||
rpc.vhost.vhost_create_blk_controller(args.client,
|
rpc.vhost.vhost_create_blk_controller(**vars(args))
|
||||||
ctrlr=args.ctrlr,
|
|
||||||
dev_name=args.dev_name,
|
|
||||||
cpumask=args.cpumask,
|
|
||||||
transport=args.transport,
|
|
||||||
readonly=args.readonly,
|
|
||||||
packed_ring=args.packed_ring,
|
|
||||||
packed_ring_recovery=args.packed_ring_recovery)
|
|
||||||
|
|
||||||
p = subparsers.add_parser('vhost_create_blk_controller', help='Add a new vhost block controller')
|
p = subparsers.add_parser('vhost_create_blk_controller', help='Add a new vhost block controller')
|
||||||
p.add_argument('ctrlr', help='controller name')
|
p.add_argument('ctrlr', help='controller name')
|
||||||
|
Loading…
Reference in New Issue
Block a user