[pve-devel] [PATCH 7/7] add qemu_volume_snapshot_delete

Alexandre Derumier aderumier at odiso.com
Thu Sep 6 10:33:40 CEST 2012


We need to split the delvm monitor command, like savevm, to delete snapshot onlinefor each volume (qcow2,sheepdog,rbd)

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/QemuServer.pm |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index a010864..8aee7a1 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -2766,6 +2766,24 @@ sub qemu_volume_snapshot {
 
 }
 
+sub qemu_volume_snapshot_delete {
+    my ($vmid, $deviceid, $storecfg, $volid, $snap) = @_;
+
+     #need to implement statefile location
+    my $statefile="/tmp/$vmid-$snap";
+
+    unlink $statefile if -e $statefile;
+
+    my $running = PVE::QemuServer::check_running($vmid);
+
+    return if !PVE::Storage::volume_snapshot_delete($storecfg, $volid, $snap, $running);
+
+    return if !$running;
+
+    #need to split delvm monitor command like savevm
+
+}
+
 sub qemu_snapshot_start {
     my ($vmid, $snap) = @_;
 
-- 
1.7.2.5



More information about the pve-devel mailing list