[pve-devel] [PATCH 1/6] add qemu_volume_snapshot

Alexandre Derumier aderumier at odiso.com
Wed Sep 5 13:26:00 CEST 2012


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

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index bb0be42..6670936 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -2753,6 +2753,19 @@ sub qemu_block_resize {
 
 }
 
+sub qemu_volume_snapshot {
+    my ($vmid, $deviceid, $storecfg, $volid, $snap) = @_;
+
+    my $running = PVE::QemuServer::check_running($vmid);
+
+    return if !PVE::Storage::volume_snapshot($storecfg, $volid, $snap, $running);
+
+    return if !$running;
+
+    vm_mon_cmd($vmid, "snapshot-drive", device => $deviceid, name => $snap);
+
+}
+
 sub vm_start {
     my ($storecfg, $vmid, $statefile, $skiplock, $migratedfrom) = @_;
 
-- 
1.7.2.5




More information about the pve-devel mailing list