[pve-devel] [PATCH 3/6] forbid vm_destroy if templates exists

Alexandre Derumier aderumier at odiso.com
Thu Nov 29 10:37:53 CET 2012


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

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index dc96b91..6b22b3e 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -3224,6 +3224,8 @@ sub vm_sendkey {
 sub vm_destroy {
     my ($storecfg, $vmid, $skiplock) = @_;
 
+    die "you can't delete a vm if template exist" if is_template($vmid, undef, 1);
+
     lock_config($vmid, sub {
 
 	my $conf = load_config($vmid);
-- 
1.7.10.4




More information about the pve-devel mailing list