mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-13 19:26:11 +00:00
forbid snapshot delete if it's a template
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
parent
624361b34a
commit
66aa07141f
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user