5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-02-12 21:57:58 +03:00

rescan: add check if config has really changed

This commit is contained in:
Dietmar Maurer 2013-05-27 09:30:40 +02:00
parent 5996a936e3
commit 7a907ce612
2 changed files with 7 additions and 2 deletions

View File

@ -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 {

View File

@ -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;
}
}
}