From 6000a061e96c6b88367e9dc5c2751c09cd0a7103 Mon Sep 17 00:00:00 2001 From: Alexandre Derumier Date: Thu, 6 Sep 2012 10:28:06 +0200 Subject: [PATCH] plugin: add volume_snapshot_delete Signed-off-by: Alexandre Derumier --- PVE/Storage/Plugin.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/PVE/Storage/Plugin.pm b/PVE/Storage/Plugin.pm index 315cded..b986037 100644 --- a/PVE/Storage/Plugin.pm +++ b/PVE/Storage/Plugin.pm @@ -534,6 +534,22 @@ sub volume_snapshot_rollback { return undef; } +sub volume_snapshot_delete { + my ($class, $scfg, $storeid, $volname, $snap, $running) = @_; + + die "can't delete snapshot for this image format" if $volname !~ m/\.(qcow2|qed)$/; + + return 1 if $running; + + my $path = $class->path($scfg, $volname); + + my $cmd = ['/usr/bin/qemu-img', 'snapshot','-d', $snap, $path]; + + run_command($cmd, timeout => 1); + + return undef; +} + sub list_images { my ($class, $storeid, $scfg, $vmid, $vollist, $cache) = @_;