forbid snapshot delete if it's a template

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
Alexandre Derumier 2013-02-14 11:58:51 +01:00 committed by Dietmar Maurer
parent 624361b34a
commit 66aa07141f

View File

@ -2899,6 +2899,10 @@ sub qemu_volume_snapshot {
sub qemu_volume_snapshot_delete {
my ($vmid, $deviceid, $storecfg, $volid, $snap) = @_;
my $conf = PVE::QemuServer::load_config($vmid);
die "you can't delete a snapshot if vm is a template" if is_template($conf);
my $running = check_running($vmid);
return if !PVE::Storage::volume_snapshot_delete($storecfg, $volid, $snap, $running);