forbid vm_start if current config is a template.

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>
This commit is contained in:
Alexandre Derumier 2013-02-14 11:58:53 +01:00 committed by Dietmar Maurer
parent 90b0c6b34a
commit 3dcb98d52b

View 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);