[pve-devel] [PATCH] template create : add template:1 option

Alexandre Derumier aderumier at odiso.com
Fri Apr 19 15:56:45 CEST 2013


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

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 8e0a378..0ddbc29 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -4474,9 +4474,11 @@ sub template_create {
     if($conf->{snapshots}){
 	delete $conf->{parent};
 	delete $conf->{snapshots};
-	PVE::QemuServer::update_config_nolock($vmid, $conf, 1);
 	#fixme : do we need to delete disks snapshots ?
     }
+    $conf->{template} = 1;
+    PVE::QemuServer::update_config_nolock($vmid, $conf, 1);
+
 }
 
 sub is_template {
-- 
1.7.10.4




More information about the pve-devel mailing list