Spdk/scripts/rpc/nbd.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

19 lines
477 B
Python
Executable File

def start_nbd_disk(client, args):
params = {
'bdev_name': args.bdev_name,
'nbd_device': args.nbd_device
}
return client.call('start_nbd_disk', params)
def stop_nbd_disk(client, args):
params = {'nbd_device': args.nbd_device}
return client.call('stop_nbd_disk', params)
def get_nbd_disks(client, args):
params = {}
if args.nbd_device:
params['nbd_device'] = args.nbd_device
return client.call('get_nbd_disks', params)