public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH storage v2 1/3] zfspoolplugin: activate_storage: minor cleanup
Date: Fri, 19 Feb 2021 13:45:42 +0100	[thread overview]
Message-ID: <20210219124544.12593-2-s.ivanov@proxmox.com> (raw)
In-Reply-To: <20210219124544.12593-1-s.ivanov@proxmox.com>

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
 PVE/Storage/ZFSPoolPlugin.pm | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/PVE/Storage/ZFSPoolPlugin.pm b/PVE/Storage/ZFSPoolPlugin.pm
index 105d802..be7b1b9 100644
--- a/PVE/Storage/ZFSPoolPlugin.pm
+++ b/PVE/Storage/ZFSPoolPlugin.pm
@@ -529,22 +529,20 @@ sub activate_storage {
     $pool =~ s!/.*$!!;
 
     my $pool_imported = sub {
-	my @param = ('-o', 'name', '-H', "$pool");
+	my @param = ('-o', 'name', '-H', $pool);
 	my $res = eval { $class->zfs_request($scfg, undef, 'zpool_list', @param) };
-	if ($@) {
-	    warn "$@\n";
-	    return undef;
-	}
+	warn "$@\n" if $@;
+
 	return defined($res) && $res =~ m/$pool/;
     };
 
     if (!$pool_imported->()) {
 	# import can only be done if not yet imported!
-	my @param = ('-d', '/dev/disk/by-id/', '-o', 'cachefile=none', "$pool");
+	my @param = ('-d', '/dev/disk/by-id/', '-o', 'cachefile=none', $pool);
 	eval { $class->zfs_request($scfg, undef, 'zpool_import', @param) };
 	if (my $err = $@) {
 	    # just could've raced with another import, so recheck if it is imported
-	    die "could not activate storage '$storeid', $@\n" if !$pool_imported->();
+	    die "could not activate storage '$storeid', $err\n" if !$pool_imported->();
 	}
     }
     return 1;
-- 
2.20.1





  reply	other threads:[~2021-02-19 12:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-19 12:45 [pve-devel] [PATCH storage v2 0/3] zfspoolplugin: check if mounted instead of imported Stoiko Ivanov
2021-02-19 12:45 ` Stoiko Ivanov [this message]
2021-02-19 13:18   ` [pve-devel] applied: [PATCH storage v2 1/3] zfspoolplugin: activate_storage: minor cleanup Thomas Lamprecht
2021-02-19 12:45 ` [pve-devel] [PATCH storage v2 2/3] zfspoolplugin: check if mounted instead of imported Stoiko Ivanov
2021-02-19 14:24   ` [pve-devel] applied: " Thomas Lamprecht
2021-02-19 12:45 ` [pve-devel] [PATCH storage v2 3/3] zfspoolplugin: check if imported before importing Stoiko Ivanov
2021-02-19 15:28   ` [pve-devel] applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210219124544.12593-2-s.ivanov@proxmox.com \
    --to=s.ivanov@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal