[pve-devel] [storage] fix #2154: Buggy "pvesm status" output

Wolfgang Link w.link at proxmox.com
Mon Apr 1 16:20:46 CEST 2019


Remove "zpool import" because there is no need for it.

zpool list <poolname> will import the pool if it is not imported.

Anyway also there is no situation where Proxmox VE framework will
export a pool.

So there should no need to import a pool in the code logic.
If an error occurs, the error output will help the admin to fix the problem.
---
 PVE/Storage/ZFSPoolPlugin.pm | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/PVE/Storage/ZFSPoolPlugin.pm b/PVE/Storage/ZFSPoolPlugin.pm
index 4bf6d50..e143c7d 100644
--- a/PVE/Storage/ZFSPoolPlugin.pm
+++ b/PVE/Storage/ZFSPoolPlugin.pm
@@ -173,9 +173,6 @@ sub zfs_request {
 
     if ($method eq 'zpool_list') {
 	push @$cmd, 'zpool', 'list';
-    } elsif ($method eq 'zpool_import') {
-	push @$cmd, 'zpool', 'import';
-	$default_timeout = 15 if $default_timeout < 15;
     } else {
 	push @$cmd, 'zfs', $method;
     }
@@ -529,13 +526,8 @@ sub activate_storage {
 	$res = $class->zfs_request($scfg, undef, 'zpool_list', @param);
     };
 
-    if ($@ || !defined($res) || $res !~ $pool) {
-	eval {
-	    @param = ('-d', '/dev/disk/by-id/', "$pool");
-	    $class->zfs_request($scfg, undef, 'zpool_import', @param);
-	};
-	die "could not activate storage '$storeid', $@\n" if $@;
-    }
+    die "could not activate storage '$storeid', $@\n" if $@;
+
     return 1;
 }
 
-- 
2.11.0





More information about the pve-devel mailing list