fix modification of read only bug
Signed-off-by: Michael Rasmussen <mir@datanom.net>
This commit is contained in:
committed by
Dietmar Maurer
parent
8c75f56d21
commit
b200cefd06
@ -241,7 +241,7 @@ my $make_lun = sub {
|
|||||||
my @options = ();
|
my @options = ();
|
||||||
my $lun = $get_lu_name->($target);
|
my $lun = $get_lu_name->($target);
|
||||||
if ($scfg->{nowritecache}) {
|
if ($scfg->{nowritecache}) {
|
||||||
push @options, "WriteCache Disable";
|
push @options, "WriteCache Disable";
|
||||||
}
|
}
|
||||||
my $conf = {
|
my $conf = {
|
||||||
lun => $lun,
|
lun => $lun,
|
||||||
@ -285,13 +285,14 @@ my $parser = sub {
|
|||||||
next if (($_ =~ /^\s*#/) || ($_ =~ /^\s*$/));
|
next if (($_ =~ /^\s*#/) || ($_ =~ /^\s*$/));
|
||||||
if ($_ =~ /^\s*(\w+)\s+(.+)\s*/) {
|
if ($_ =~ /^\s*(\w+)\s+(.+)\s*/) {
|
||||||
my $arg1 = $1;
|
my $arg1 = $1;
|
||||||
$2 =~ s/^\s+|\s+$|"\s*//g;
|
my $arg2 = $2;
|
||||||
if ($2 =~ /^Storage\s*(.+)/i) {
|
$arg2 =~ s/^\s+|\s+$|"\s*//g;
|
||||||
|
if ($arg2 =~ /^Storage\s*(.+)/i) {
|
||||||
$SETTINGS->{$lun}->{$arg1}->{storage} = $1;
|
$SETTINGS->{$lun}->{$arg1}->{storage} = $1;
|
||||||
} elsif ($2 =~ /^Option\s*(.+)/i) {
|
} elsif ($arg2 =~ /^Option\s*(.+)/i) {
|
||||||
push @{$SETTINGS->{$lun}->{$arg1}->{options}}, $1;
|
push @{$SETTINGS->{$lun}->{$arg1}->{options}}, $1;
|
||||||
} else {
|
} else {
|
||||||
$SETTINGS->{$lun}->{$arg1} = $2;
|
$SETTINGS->{$lun}->{$arg1} = $arg2;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
die "$line: parse error [$_]";
|
die "$line: parse error [$_]";
|
||||||
|
|||||||
Reference in New Issue
Block a user