use base qw(PVE::Storage::Plugin);
use Fcntl qw(S_ISDIR O_WRONLY O_CREAT O_EXCL);
-use File::Basename qw(dirname);
+use File::Basename qw(basename dirname);
use File::Path qw(mkpath);
use IO::Dir;
use POSIX qw(EEXIST);
shared => { optional => 1 },
disable => { optional => 1 },
maxfiles => { optional => 1 },
- 'prune-backups'=> { optional => 1 },
+ 'prune-backups' => { optional => 1 },
+ 'max-protected-backups' => { optional => 1 },
content => { optional => 1 },
format => { optional => 1 },
is_mountpoint => { optional => 1 },
nocow => { optional => 1 },
mkdir => { optional => 1 },
+ preallocation => { optional => 1 },
# TODO: The new variant of mkdir with `populate` vs `create`...
};
}
return PVE::Storage::DirPlugin::status($class, $storeid, $scfg, $cache);
}
-# TODO: sub get_volume_notes {}
+# TODO: sub get_volume_attribute {}
-# TODO: sub update_volume_notes {}
+# TODO: sub update_volume_attribute {}
# croak would not include the caller from within this module
sub __error {
my ($class, $storeid, $scfg, $vmid, $fmt, $name, $size) = @_;
if ($fmt ne 'raw' && $fmt ne 'subvol') {
- return $class->SUPER::alloc_image($storeid, $scfg, $vmid, $fmt, $name, $size)
+ return $class->SUPER::alloc_image($storeid, $scfg, $vmid, $fmt, $name, $size);
}
# From Plugin.pm:
$class->parse_volname($volname);
if (!defined($format) || ($format ne 'subvol' && $format ne 'raw')) {
- return PVE::Storage::DirPlugin->free_image($storeid, $scfg, $volname, $isBase, $_format);
+ return $class->SUPER::free_image($storeid, $scfg, $volname, $isBase, $_format);
}
my $path = $class->filesystem_path($scfg, $volname);
}
my $dir = dirname($subvol);
+ my $basename = basename($subvol);
my @snapshot_vols;
foreach_subvol($dir, sub {
my ($volume, $name, $snapshot) = @_;
+ return if $name ne $basename;
return if !defined $snapshot;
push @snapshot_vols, "$dir/$volume";
});
}
sub volume_rollback_is_possible {
- my ($class, $scfg, $storeid, $volname, $snap) = @_;
+ my ($class, $scfg, $storeid, $volname, $snap, $blockers) = @_;
return 1;
}
current => { raw => 1 },
snap => { raw => 1 },
},
- template => { current => { qcow2 => 1, raw => 1, vmdk => 1, subvol => 1 } },
+ template => {
+ current => { qcow2 => 1, raw => 1, vmdk => 1, subvol => 1 },
+ },
copy => {
base => { qcow2 => 1, raw => 1, subvol => 1, vmdk => 1 },
current => { qcow2 => 1, raw => 1, subvol => 1, vmdk => 1 },
snap => { qcow2 => 1, raw => 1, subvol => 1 },
},
- sparseinit => { base => {qcow2 => 1, raw => 1, vmdk => 1 },
- current => {qcow2 => 1, raw => 1, vmdk => 1 } },
+ sparseinit => {
+ base => { qcow2 => 1, raw => 1, vmdk => 1 },
+ current => { qcow2 => 1, raw => 1, vmdk => 1 },
+ },
};
- my ($vtype, $name, $vmid, $basename, $basevmid, $isBase, $format) =
- $class->parse_volname($volname);
+ my ($vtype, $name, $vmid, $basename, $basevmid, $isBase, $format) = $class->parse_volname($volname);
my $key = undef;
if ($snapname) {