From ffafd9680228ec5c39cc721f0db50b7babc2c91d Mon Sep 17 00:00:00 2001 From: Prasanna Kumar Kalever Date: Fri, 6 Apr 2018 13:19:54 +0530 Subject: create: add a way to set control string this patch enable users to supply control option, a string containing comma separated control=value kind tuples, that are passed to the kernel control file. Example: $ targetcli /backstores/user:glfs create blockX1 1073741824 \ test@192.168.124.227/block-store/e59309bb-d591-4121-a891-e98ff3416446 \ control="max_data_area_mb=32,hw_max_sectors=256" Signed-off-by: Prasanna Kumar Kalever --- targetcli/ui_backstore.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'targetcli') diff --git a/targetcli/ui_backstore.py b/targetcli/ui_backstore.py index efa532f..0af29f0 100644 --- a/targetcli/ui_backstore.py +++ b/targetcli/ui_backstore.py @@ -615,7 +615,7 @@ class UIUserBackedBackstore(UIBackstore): print() def ui_command_create(self, name, size, cfgstring, wwn=None, - hw_max_sectors=None): + hw_max_sectors=None, control=None): ''' Creates a User-backed storage object. @@ -641,7 +641,8 @@ class UIUserBackedBackstore(UIBackstore): try: so = UserBackedStorageObject(name, size=size, config=config, - wwn=wwn, hw_max_sectors=hw_max_sectors) + wwn=wwn, hw_max_sectors=hw_max_sectors, + control=control) except: raise ExecutionError("UserBackedStorageObject creation failed.") @@ -675,6 +676,7 @@ class UIStorageObject(UIRTSLibNode): 'fabric_max_sectors': ('number', 'Maximum number of sectors the fabric can transfer at once.'), 'hw_block_size': ('number', 'Hardware block size in bytes.'), 'hw_max_sectors': ('number', 'Maximum number of sectors the hardware can transfer at once.'), + 'control': ('string', 'Comma separated string of control=value tuples that will be passed to kernel control file.'), 'hw_pi_prot_type': ('number', 'If non-zero, DIF protection is enabled on the underlying hardware.'), 'hw_queue_depth': ('number', 'Hardware queue depth.'), 'is_nonrot': ('number', 'If set to 1, the backstore is a non rotational device.'), -- cgit v1.2.1