summaryrefslogtreecommitdiff
path: root/targetcli
diff options
context:
space:
mode:
authorPrasanna Kumar Kalever <prasanna.kalever@redhat.com>2018-04-06 13:19:54 +0530
committerPrasanna Kumar Kalever <prasanna.kalever@redhat.com>2018-04-17 17:14:54 +0530
commitffafd9680228ec5c39cc721f0db50b7babc2c91d (patch)
tree8595c04cb2926ec98fcc8ed0291e82f21dac8892 /targetcli
parent30b7783ea3fcfd90ad6c146690f6d673368bf18b (diff)
downloadtargetcli-ffafd9680228ec5c39cc721f0db50b7babc2c91d.tar.gz
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 <prasanna.kalever@redhat.com>
Diffstat (limited to 'targetcli')
-rw-r--r--targetcli/ui_backstore.py6
1 files changed, 4 insertions, 2 deletions
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.'),