[pve-devel] Fw: [PATCH] allow using more than one pool on an Iet iSCSI server with ZFS
Michael Rasmussen
mir at datanom.net
Mon Feb 29 17:20:38 CET 2016
Missed reply-to list.
Begin forwarded message:
Date: Mon, 29 Feb 2016 00:05:29 +0100
From: Michael Rasmussen <mir at datanom.net>
To: Dietmar Maurer <dietmar at proxmox.com>
Subject: Re: [pve-devel] [PATCH] allow using more than one pool on an
Iet iSCSI server with ZFS
Hi Dietmar,
Unless the parser method is refactored to contain the configuration
for every configured pool then the method update_config will fail since
this method writes the complete configuration and overwrites the
existing configuration. The patch provided will only contain
configuration for one specific pool at the time:
"
+ if ($SETTINGS->{pool} ne $scfg->{pool}) {
+ $SETTINGS=undef;
+ $parser->($scfg);
+ }
"
The parser must be able to parser every configured pool each time it is
executed adding an extra layer to the hash:
{
"tank1" => { current_settings_hash },
"tank2" => { current_settings_hash },
...
}
I hope I have made myself clear?
On Sat, 27 Feb 2016 09:52:41 +0100 (CET)
Dietmar Maurer <dietmar at proxmox.com> wrote:
> @mir: Please can you review?
>
> > 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
> >
> > _______________________________________________
> > pve-devel mailing list
> > pve-devel at pve.proxmox.com
> > http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
>
--
Hilsen/Regards
Michael Rasmussen
Get my public GnuPG keys:
michael <at> rasmussen <dot> cc
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xD3C9A00E
mir <at> datanom <dot> net
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE501F51C
mir <at> miras <dot> org
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE3E80917
--------------------------------------------------------------
/usr/games/fortune -es says:
He hated being thought of as one of those people that wore stupid
ornamental armour. It was gilt by association.
-- Terry Pratchett, "Night Watch"
--
Hilsen/Regards
Michael Rasmussen
Get my public GnuPG keys:
michael <at> rasmussen <dot> cc
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xD3C9A00E
mir <at> datanom <dot> net
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE501F51C
mir <at> miras <dot> org
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE3E80917
--------------------------------------------------------------
/usr/games/fortune -es says:
The best diplomat I know is a fully activated phaser bank.
-- Scotty
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://lists.proxmox.com/pipermail/pve-devel/attachments/20160229/bea1d546/attachment.sig>
More information about the pve-devel
mailing list