[pve-devel] [PATCH] allow using more than one pool on an Iet iSCSI server with ZFS

Markus Köberl markus.koeberl at tugraz.at
Thu Feb 25 14:13:38 CET 2016


Signed-off-by: Markus Köberl <markus.koeberl at tugraz.at>
---
 PVE/Storage/LunCmd/Iet.pm |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/PVE/Storage/LunCmd/Iet.pm b/PVE/Storage/LunCmd/Iet.pm
index 4a8ebd5..9eae859 100644
--- a/PVE/Storage/LunCmd/Iet.pm
+++ b/PVE/Storage/LunCmd/Iet.pm
@@ -145,6 +145,7 @@ my $parser = sub {
                 # start colect info
                 die "$line: Parse error [$_]" if $SETTINGS;
                 $SETTINGS->{target} = $1;
+                $SETTINGS->{pool} = $scfg->{pool};
                 $cfg_target = 1;
             } elsif ($1 eq $scfg->{target} && $cfg_target) {
                 die "$line: Parse error [$_]";
@@ -202,7 +203,7 @@ my $update_config = sub {
     my $config = '';
 
     while ((my $option, my $value) = each(%$SETTINGS)) {
-        next if ($option eq 'include' || $option eq 'luns' || $option eq 'Path' || $option eq 'text' || $option eq 'used');
+        next if ($option eq 'pool' || $option eq 'include' || $option eq 'luns' || $option eq 'Path' || $option eq 'text' || $option eq 'used');
         if ($option eq 'target') {
             $config = "\n\nTarget " . $SETTINGS->{target} . "\n" . $config;
         } else {
@@ -212,7 +213,7 @@ my $update_config = sub {
     foreach my $lun (@{$SETTINGS->{luns}}) {
         my $lun_opt = '';
         while ((my $option, my $value) = each(%$lun)) {
-            next if ($option eq 'include' || $option eq 'lun' || $option eq 'Path');
+            next if ($option eq 'pool' || $option eq 'include' || $option eq 'lun' || $option eq 'Path');
             if ($lun_opt eq '') {
             $lun_opt = $option . '=' . $value;
             } else {
@@ -464,6 +465,10 @@ sub run_lun_command {
     my ($scfg, $timeout, $method, @params) = @_;
 
     $parser->($scfg) unless $SETTINGS;
+    if ($SETTINGS->{pool} ne $scfg->{pool}) {
+        $SETTINGS=undef;
+        $parser->($scfg);
+    }
     my $cmdmap = $get_lun_cmd_map->($method);
     my $msg = $cmdmap->{cmd}->($scfg, $timeout, $method, @params);
 
-- 
1.7.10.4




More information about the pve-devel mailing list