added support for bsoflags parameter
PATCH 1/1 added support for bsoflags parameter
From: Cédric Milesi <[email protected]>
This patch will allow one to use bsoflags with tgt-admin.
---
Signed-off-by Cédric Milesi <[email protected]>
--- scripts/tgt-admin | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
scripts/tgt-admin +12 -1
@@ -493,6 +493,7 @@ sub add_backing_direct { my $device_type; my $bs_type; my $bsopts; + my $bsoflags; my $block_size; my %luns; my @added_luns;
@@ -548,6 +549,10 @@ sub add_backing_direct { $bsopts = $result; $params_added{$store_option} = 1; } + if ($store_option eq "bsoflags") { + $bsoflags = $result; + $params_added{$store_option} = 1; + } if ($store_option eq "block-size") { $block_size = $result; $params_added{$store_option} = 1;
@@ -704,6 +709,11 @@ sub add_backing_direct { check_if_hash_array($$target_options_ref{"bsopts"}, "bsopts"); $bsopts = $$target_options_ref{"bsopts"}; } + # bsoflags + if ($params_added{"bsoflags"} ne 1) { + check_if_hash_array($$target_options_ref{"bsoflags"}, "bsoflags"); + $bsoflags = $$target_options_ref{"bsoflags"}; + } } else { print "If you got here, this means your config file is not supported.\n"; print "Please report it to stgt mailing list and attach your config files.\n";
@@ -713,8 +723,9 @@ sub add_backing_direct { if (length $device_type) { $device_type = "--device-type $device_type" }; if (length $bs_type) { $bs_type = "--bstype $bs_type" }; if (length $bsopts) { $bsopts = "--bsopts $bsopts" }; + if (length $bsoflags) { $bsoflags = "--bsoflags $bsoflags" }; if (length $block_size) { $block_size = "--blocksize $block_size" }; - execute("tgtadm -C $control_port --lld $driver --op new --mode logicalunit --tid $next_tid --lun $lun -b $backing_store $device_type $bs_type $bsopts $block_size"); + execute("tgtadm -C $control_port --lld $driver --op new --mode logicalunit --tid $next_tid --lun $lun -b $backing_store $device_type $bs_type $bsopts $bsoflags $block_size"); # Commands should be executed in order my @execute_last;
Signature · 1 line
1.8.3.2
FUJITA Tomonori
AppliedQuoted 9 lines · On Tue, 6 May 2014 17:31:04 +0200 Cedric Milesi <[email protected]> wrote:
From: Cédric Milesi <[email protected]>
This patch will allow one to use bsoflags with tgt-admin.
---
Signed-off-by Cédric Milesi <[email protected]>--- scripts/tgt-admin | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
Applied, thanks!