Hi there,
This patch add the support of the bsoflags option (method to access
the backing store device) in tgt-admin.
Without this patch, bsoflags option within a backing-store block is not
recognized.
Cheers
Cedric
From 8fab954ca05bd193328a4f21400a2097bbdb7124 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9dric=20Milesi?= <cedric.milesi@xxxxxx>
Date: Wed, 26 Feb 2014 18:34:15 +0100
Subject: [PATCH] added support for bsoflags parameter
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Cédric Milesi <cedric.milesi@xxxxxx>
---
scripts/tgt-admin | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/scripts/tgt-admin b/scripts/tgt-admin
index 5486507..7130a3d 100755
--- a/scripts/tgt-admin
+++ b/scripts/tgt-admin
@@ -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;
--
1.8.3.2
--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html