]> git.proxmox.com Git - pve-storage.git/commitdiff
ZFSPoolPlugin: allow nested datasets
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 30 Apr 2015 04:45:29 +0000 (06:45 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 30 Apr 2015 04:48:39 +0000 (06:48 +0200)
PVE/Storage/ZFSPoolPlugin.pm

index 39fc3484b95697a503ec0ff802b24355602e0099..b3f3e37a32821b8760150b3d22730bda317f010d 100644 (file)
@@ -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 <pool>/<dataset>
+    my $pool = $scfg->{pool};
+    $pool =~ s!/.*$!!;
+
+    if ($text !~ $pool) {
        run_command("zpool import -d /dev/disk/by-id/ -a");
     }
     return 1;