]> git.proxmox.com Git - qemu-server.git/commitdiff
forbid vm_start if current config is a template.
authorAlexandre Derumier <aderumier@odiso.com>
Thu, 14 Feb 2013 10:58:53 +0000 (11:58 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 15 Feb 2013 06:52:28 +0000 (07:52 +0100)
if files (raw,qcow2) are a template, we forbid vm_start.

note : the readonly protection do already the job, but we need a clear message for users

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
PVE/QemuServer.pm

index 4a70d7018d383ac653d4a7548e4ecd5e30e74306..e8697b34d3362fe939fa9c97c708e7088953a940 100644 (file)
@@ -2930,6 +2930,8 @@ sub vm_start {
     lock_config($vmid, sub {
        my $conf = load_config($vmid, $migratedfrom);
 
+       die "you can't start a vm if it's a template" if is_template($conf);
+
        check_lock($conf) if !$skiplock;
 
        die "VM $vmid already running\n" if check_running($vmid, undef, $migratedfrom);