]> git.proxmox.com Git - pve-storage.git/commitdiff
zfs_parse_zvol_list: do not add pool to volname
authorDietmar Maurer <dietmar@proxmox.com>
Mon, 10 Aug 2015 14:53:19 +0000 (16:53 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 10 Aug 2015 14:53:19 +0000 (16:53 +0200)
Else, alloc and list return different volids.

PVE/Storage.pm
PVE/Storage/ZFSPoolPlugin.pm

index 55af5ee47efdf014d544eab4b7db76ff6a8c11f4..1c622c461b22143441c15bd8275eb1784cad285e 100755 (executable)
@@ -2,6 +2,7 @@ package PVE::Storage;
 
 use strict;
 use warnings;
+use Data::Dumper;
 
 use POSIX;
 use IO::Select;
index d3bb0fd4e52995a2d9c3c4dc9ed265e243efcd9a..92c3168379579b90c6a0ffac77997f5044df8c5d 100644 (file)
@@ -98,14 +98,13 @@ sub zfs_parse_zvol_list {
 
        my $zvol = {};
        my @parts = split /\//, $dataset;
+       next if scalar(@parts) < 2; # we need pool/name
        my $name = pop @parts;
        my $pool = join('/', @parts);
 
        next unless $name =~ m!^(vm|base|subvol)-(\d+)-(\S+)$!;
        $zvol->{owner} = $2;
 
-       $name = $pool . '/' . $name;
-
        $zvol->{pool} = $pool;
        $zvol->{name} = $name;
        if ($type eq 'filesystem') {