diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 61282d52..2df6d88c 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -662,6 +662,7 @@ my $delete_drive = sub { my $volid = $drive->{file}; if (&$vm_is_volid_owner($storecfg, $vmid, $volid)) { if ($force || $key =~ m/^unused/) { + # fixme: aliases!! eval { PVE::Storage::vdisk_free($storecfg, $volid); }; die $@ if $@; } else { diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 64c95f0d..db767d66 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -1696,6 +1696,7 @@ sub write_vm_config { my $used_volids = {}; + # fixme: allow to add unused disk even if disk is used inside snapshot my $cleanup_config = sub { my ($cref) = @_; @@ -3643,8 +3644,11 @@ sub update_disksize { next if !$volid_hash->{$volid}; $drive->{size} = $volid_hash->{$volid}->{size}; - $changes = 1; - $conf->{$opt} = print_drive($vmid, $drive); + my $new = print_drive($vmid, $drive); + if ($new ne $conf->{$opt}) { + $changes = 1; + $conf->{$opt} = $new; + } } }