]> git.proxmox.com Git - qemu-server.git/commitdiff
forbid snapshot create if current it's a template
authorAlexandre Derumier <aderumier@odiso.com>
Thu, 14 Feb 2013 10:58:55 +0000 (11:58 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 15 Feb 2013 06:57:01 +0000 (07:57 +0100)
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
PVE/QemuServer.pm

index e8697b34d3362fe939fa9c97c708e7088953a940..32d2a871d1bc26e318ae2670ae5bdca4a0e07953 100644 (file)
@@ -2886,6 +2886,10 @@ sub qemu_block_resize {
 sub qemu_volume_snapshot {
     my ($vmid, $deviceid, $storecfg, $volid, $snap) = @_;
 
+    my $conf = PVE::QemuServer::load_config($vmid);
+
+    die "you can't take a snapshot if it's a template" if is_template($conf);
+
     my $running = check_running($vmid);
 
     return if !PVE::Storage::volume_snapshot($storecfg, $volid, $snap, $running);