mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-08 05:53:29 +00:00
rescan: add check if config has really changed
This commit is contained in:
parent
5996a936e3
commit
7a907ce612
@ -662,6 +662,7 @@ my $delete_drive = sub {
|
|||||||
my $volid = $drive->{file};
|
my $volid = $drive->{file};
|
||||||
if (&$vm_is_volid_owner($storecfg, $vmid, $volid)) {
|
if (&$vm_is_volid_owner($storecfg, $vmid, $volid)) {
|
||||||
if ($force || $key =~ m/^unused/) {
|
if ($force || $key =~ m/^unused/) {
|
||||||
|
# fixme: aliases!!
|
||||||
eval { PVE::Storage::vdisk_free($storecfg, $volid); };
|
eval { PVE::Storage::vdisk_free($storecfg, $volid); };
|
||||||
die $@ if $@;
|
die $@ if $@;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1696,6 +1696,7 @@ sub write_vm_config {
|
|||||||
|
|
||||||
my $used_volids = {};
|
my $used_volids = {};
|
||||||
|
|
||||||
|
# fixme: allow to add unused disk even if disk is used inside snapshot
|
||||||
my $cleanup_config = sub {
|
my $cleanup_config = sub {
|
||||||
my ($cref) = @_;
|
my ($cref) = @_;
|
||||||
|
|
||||||
@ -3643,8 +3644,11 @@ sub update_disksize {
|
|||||||
next if !$volid_hash->{$volid};
|
next if !$volid_hash->{$volid};
|
||||||
|
|
||||||
$drive->{size} = $volid_hash->{$volid}->{size};
|
$drive->{size} = $volid_hash->{$volid}->{size};
|
||||||
|
my $new = print_drive($vmid, $drive);
|
||||||
|
if ($new ne $conf->{$opt}) {
|
||||||
$changes = 1;
|
$changes = 1;
|
||||||
$conf->{$opt} = print_drive($vmid, $drive);
|
$conf->{$opt} = $new;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user