numam-spdk/scripts/rpc/vhost.py
Daniel Verkamp 96dc91d608 scripts/rpc.py: pass client as separate parameter
Split client out of the args object and pass it as the first parameter
to all RPC methods instead.  This is a step toward decoupling the
rpc/*.py interface from the argparse front end.

Change-Id: Ib030862e0c79112e5c9acdde295d68983126a987
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405502
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-30 16:48:47 -04:00

104 lines
2.7 KiB
Python
Executable File

def set_vhost_controller_coalescing(client, args):
params = {
'ctrlr': args.ctrlr,
'delay_base_us': args.delay_base_us,
'iops_threshold': args.iops_threshold,
}
return client.call('set_vhost_controller_coalescing', params)
def construct_vhost_scsi_controller(client, args):
params = {'ctrlr': args.ctrlr}
if args.cpumask:
params['cpumask'] = args.cpumask
return client.call('construct_vhost_scsi_controller', params)
def add_vhost_scsi_lun(client, args):
params = {
'ctrlr': args.ctrlr,
'bdev_name': args.bdev_name,
'scsi_target_num': args.scsi_target_num
}
return client.call('add_vhost_scsi_lun', params)
def remove_vhost_scsi_target(client, args):
params = {
'ctrlr': args.ctrlr,
'scsi_target_num': args.scsi_target_num
}
return client.call('remove_vhost_scsi_target', params)
def construct_vhost_blk_controller(client, args):
params = {
'ctrlr': args.ctrlr,
'dev_name': args.dev_name,
}
if args.cpumask:
params['cpumask'] = args.cpumask
if args.readonly:
params['readonly'] = args.readonly
return client.call('construct_vhost_blk_controller', params)
def get_vhost_controllers(client, args):
return client.call('get_vhost_controllers')
def remove_vhost_controller(client, args):
params = {'ctrlr': args.ctrlr}
return client.call('remove_vhost_controller', params)
def construct_virtio_user_scsi_bdev(client, args):
params = {
'path': args.path,
'name': args.name,
}
if args.vq_count:
params['vq_count'] = args.vq_count
if args.vq_size:
params['vq_size'] = args.vq_size
return client.call('construct_virtio_user_scsi_bdev', params)
def construct_virtio_pci_scsi_bdev(client, args):
params = {
'pci_address': args.pci_address,
'name': args.name,
}
return client.call('construct_virtio_pci_scsi_bdev', params)
def remove_virtio_scsi_bdev(client, args):
params = {'name': args.name}
return client.call('remove_virtio_scsi_bdev', params)
def get_virtio_scsi_devs(client, args):
return client.call('get_virtio_scsi_devs')
def construct_virtio_user_blk_bdev(client, args):
params = {
'path': args.path,
'name': args.name,
}
if args.vq_count:
params['vq_count'] = args.vq_count
if args.vq_size:
params['vq_size'] = args.vq_size
return client.call('construct_virtio_user_blk_bdev', params)
def construct_virtio_pci_blk_bdev(client, args):
params = {
'pci_address': args.pci_address,
'name': args.name,
}
return client.call('construct_virtio_pci_blk_bdev', params)