From 41dffa853d509b1d3de81270a348b1929fe57701 Mon Sep 17 00:00:00 2001 From: Alexandre Derumier Date: Thu, 6 Sep 2012 10:27:59 +0200 Subject: [PATCH] plugin : add volume_snapshot_rollback Signed-off-by: Alexandre Derumier --- PVE/Storage/Plugin.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/PVE/Storage/Plugin.pm b/PVE/Storage/Plugin.pm index 6360aeb..315cded 100644 --- a/PVE/Storage/Plugin.pm +++ b/PVE/Storage/Plugin.pm @@ -520,6 +520,20 @@ sub volume_snapshot { return undef; } +sub volume_snapshot_rollback { + my ($class, $scfg, $storeid, $volname, $snap) = @_; + + die "can't rollback snapshot this image format" if $volname !~ m/\.(qcow2|qed)$/; + + my $path = $class->path($scfg, $volname); + + my $cmd = ['/usr/bin/qemu-img', 'snapshot','-a', $snap, $path]; + + run_command($cmd, timeout => 1); + + return undef; +} + sub list_images { my ($class, $storeid, $scfg, $vmid, $vollist, $cache) = @_;