zfspool: add blockers parameter to volume_snapshot_is_possible

useful for rollback, so that only the required replication snapshots
can be removed, and it's possible to abort early without deleting any
replication snapshots if there are other non-replication snasphots
blocking rollback.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
Fabian Ebner
2021-08-12 13:01:01 +02:00
committed by Fabian Grünbichler
parent ac5c1af57c
commit 9a5d50950c
4 changed files with 24 additions and 10 deletions

View File

@ -269,13 +269,13 @@ sub volume_resize {
}
sub volume_rollback_is_possible {
my ($cfg, $volid, $snap) = @_;
my ($cfg, $volid, $snap, $blockers) = @_;
my ($storeid, $volname) = parse_volume_id($volid, 1);
if ($storeid) {
my $scfg = storage_config($cfg, $storeid);
my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
return $plugin->volume_rollback_is_possible($scfg, $storeid, $volname, $snap);
return $plugin->volume_rollback_is_possible($scfg, $storeid, $volname, $snap, $blockers);
} elsif ($volid =~ m|^(/.+)$| && -e $volid) {
die "snapshot rollback file/device '$volid' is not possible\n";
} else {