zfs_parse_zvol_list: do not add pool to volname
Else, alloc and list return different volids.
This commit is contained in:
@ -2,6 +2,7 @@ package PVE::Storage;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Data::Dumper;
|
||||
|
||||
use POSIX;
|
||||
use IO::Select;
|
||||
|
||||
@ -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') {
|
||||
|
||||
Reference in New Issue
Block a user