[pve-devel] [PATCH v2 pve-storage] volume_snapshot_delete: deactivate before deleting
Wolfgang Bumiller
w.bumiller at proxmox.com
Fri Sep 25 12:02:33 CEST 2015
---
Changed: Moved the deactiave call from Storage.pm to the plugins as
they are also the ones dealing with the $running parameter.
PVE/Storage/Plugin.pm | 2 ++
PVE/Storage/RBDPlugin.pm | 2 ++
PVE/Storage/SheepdogPlugin.pm | 2 ++
PVE/Storage/ZFSPoolPlugin.pm | 1 +
4 files changed, 7 insertions(+)
diff --git a/PVE/Storage/Plugin.pm b/PVE/Storage/Plugin.pm
index 0eb9e73..6a1d6b6 100644
--- a/PVE/Storage/Plugin.pm
+++ b/PVE/Storage/Plugin.pm
@@ -709,6 +709,8 @@ sub volume_snapshot_delete {
my $path = $class->filesystem_path($scfg, $volname);
+ $class->deactivate_volume($storeid, $scfg, $volname, $snap, {});
+
my $cmd = ['/usr/bin/qemu-img', 'snapshot','-d', $snap, $path];
run_command($cmd);
diff --git a/PVE/Storage/RBDPlugin.pm b/PVE/Storage/RBDPlugin.pm
index 71edc8b..730fb85 100644
--- a/PVE/Storage/RBDPlugin.pm
+++ b/PVE/Storage/RBDPlugin.pm
@@ -569,6 +569,8 @@ sub volume_snapshot_delete {
return 1 if $running;
+ $class->deactivate_volume($storeid, $scfg, $volname, $snap, {});
+
my ($vtype, $name, $vmid) = $class->parse_volname($volname);
my (undef, undef, undef, $protected) = rbd_volume_info($scfg, $storeid, $name, $snap);
diff --git a/PVE/Storage/SheepdogPlugin.pm b/PVE/Storage/SheepdogPlugin.pm
index 527c6c6..6368cf4 100644
--- a/PVE/Storage/SheepdogPlugin.pm
+++ b/PVE/Storage/SheepdogPlugin.pm
@@ -416,6 +416,8 @@ sub volume_snapshot_delete {
return 1 if $running;
+ $class->deactivate_volume($storeid, $scfg, $volname, $snap, {});
+
my ($vtype, $name, $vmid, $basename, $basevmid, $isBase) =
$class->parse_volname($volname);
diff --git a/PVE/Storage/ZFSPoolPlugin.pm b/PVE/Storage/ZFSPoolPlugin.pm
index 632645f..8002dda 100644
--- a/PVE/Storage/ZFSPoolPlugin.pm
+++ b/PVE/Storage/ZFSPoolPlugin.pm
@@ -462,6 +462,7 @@ sub volume_snapshot {
sub volume_snapshot_delete {
my ($class, $scfg, $storeid, $volname, $snap, $running) = @_;
+ $class->deactivate_volume($storeid, $scfg, $volname, $snap, {});
$class->zfs_request($scfg, undef, 'destroy', "$scfg->{pool}/$volname\@$snap");
}
--
2.1.4
More information about the pve-devel
mailing list