From dc18abe07bff4b0bf65e3a25c0ebad4c256fc174 Mon Sep 17 00:00:00 2001 From: Wolfgang Link Date: Tue, 16 Apr 2019 15:18:22 +0200 Subject: [PATCH] ZFS Pool: improve error output from activate_storage related to #2154 which has some issues on zpool list, but we do not see the error messages from that step : Buggy "pvesm status" output --- PVE/Storage/ZFSPoolPlugin.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/PVE/Storage/ZFSPoolPlugin.pm b/PVE/Storage/ZFSPoolPlugin.pm index 4f16351..9ba3999 100644 --- a/PVE/Storage/ZFSPoolPlugin.pm +++ b/PVE/Storage/ZFSPoolPlugin.pm @@ -528,13 +528,16 @@ sub activate_storage { eval { $res = $class->zfs_request($scfg, undef, 'zpool_list', @param); }; - - if ($@ || !defined($res) || $res !~ $pool) { + my $err = $@; + if ($err || !defined($res) || $res !~ $pool) { eval { @param = ('-d', '/dev/disk/by-id/', '-o', 'cachefile=none', "$pool"); $class->zfs_request($scfg, undef, 'zpool_import', @param); }; - die "could not activate storage '$storeid', $@\n" if $@; + if ($@) { + warn "$err\n"; + die "could not activate storage '$storeid', $@\n"; + } } return 1; } -- 2.39.2