From 93124ef4fe3984a0584e76d2bf2f5a0a1338addb Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Thu, 30 Apr 2015 06:45:29 +0200 Subject: [PATCH] ZFSPoolPlugin: allow nested datasets --- PVE/Storage/ZFSPoolPlugin.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/PVE/Storage/ZFSPoolPlugin.pm b/PVE/Storage/ZFSPoolPlugin.pm index 39fc348..b3f3e37 100644 --- a/PVE/Storage/ZFSPoolPlugin.pm +++ b/PVE/Storage/ZFSPoolPlugin.pm @@ -449,8 +449,12 @@ sub activate_storage { my @param = ('-o', 'name', '-H'); my $text = zfs_request($class, $scfg, undef, 'zpool_list', @param); - - if ($text !~ $scfg->{pool}) { + + # Note: $scfg->{pool} can include dataset / + my $pool = $scfg->{pool}; + $pool =~ s!/.*$!!; + + if ($text !~ $pool) { run_command("zpool import -d /dev/disk/by-id/ -a"); } return 1; -- 2.39.5