[pve-devel] [PATCH] qemu_volume_snapshot_delete : fix krbd snapshot delete
Alexandre Derumier
aderumier at odiso.com
Mon Nov 14 13:01:21 CET 2016
like for snapshot, we need to check if krbd is enabled, to known
if we need to use qmp delete-drive-snapshot or storage command directly
Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
PVE/QemuServer.pm | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 13c99d2..f606fc0 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -3990,11 +3990,11 @@ sub qemu_volume_snapshot_delete {
my $running = check_running($vmid);
- return if !PVE::Storage::volume_snapshot_delete($storecfg, $volid, $snap, $running);
-
- return if !$running;
-
- vm_mon_cmd($vmid, "delete-drive-snapshot", device => $deviceid, name => $snap);
+ if ($running && do_snapshots_with_qemu($storecfg, $volid)){
+ vm_mon_cmd($vmid, "delete-drive-snapshot", device => $deviceid, name => $snap);
+ } else {
+ PVE::Storage::volume_snapshot_delete($storecfg, $volid, $snap, $running);
+ }
}
sub set_migration_caps {
--
2.1.4
More information about the pve-devel
mailing list