mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-03 19:57:54 +00:00
forbid snapshot create if current it's a template
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
parent
d560409207
commit
f78fe36ece
@ -2886,6 +2886,10 @@ sub qemu_block_resize {
|
|||||||
sub qemu_volume_snapshot {
|
sub qemu_volume_snapshot {
|
||||||
my ($vmid, $deviceid, $storecfg, $volid, $snap) = @_;
|
my ($vmid, $deviceid, $storecfg, $volid, $snap) = @_;
|
||||||
|
|
||||||
|
my $conf = PVE::QemuServer::load_config($vmid);
|
||||||
|
|
||||||
|
die "you can't take a snapshot if it's a template" if is_template($conf);
|
||||||
|
|
||||||
my $running = check_running($vmid);
|
my $running = check_running($vmid);
|
||||||
|
|
||||||
return if !PVE::Storage::volume_snapshot($storecfg, $volid, $snap, $running);
|
return if !PVE::Storage::volume_snapshot($storecfg, $volid, $snap, $running);
|
||||||
|
Loading…
Reference in New Issue
Block a user