[pve-devel] [PATCH 04/10] forbid vm_destroy if templates exists
Alexandre Derumier
aderumier at odiso.com
Wed Dec 12 13:26:14 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 7c23a07..f628f43 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -3230,6 +3230,8 @@ sub vm_destroy {
my $conf = load_config($vmid);
+ die "you can't delete a vm if template exist" if is_template($conf, undef, 1);
+
check_lock($conf) if !$skiplock;
if (!check_running($vmid)) {
--
1.7.10.4
More information about the pve-devel
mailing list