mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-06 02:42:04 +00:00
Also update disk size if there was no old size
If for whatever reason there is no size in the property string of a drive, 'qm rescan' would do nothing for that drive and live migration would also fail. Also adds a check to avoid potential auto-vivification of volid_hash->{$volid} Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
a3597c9448
commit
63e313f386
@ -573,10 +573,12 @@ sub update_disksize {
|
||||
my $volid = $drive->{file};
|
||||
return undef if !defined($volid);
|
||||
|
||||
my $oldsize = $drive->{size};
|
||||
my $oldsize = $drive->{size} // 0;
|
||||
|
||||
return undef if !defined($volid_hash->{$volid}) || !defined($volid_hash->{$volid}->{size});
|
||||
my $newsize = $volid_hash->{$volid}->{size};
|
||||
|
||||
if (defined($newsize) && defined($oldsize) && $newsize != $oldsize) {
|
||||
if ($newsize != $oldsize) {
|
||||
$drive->{size} = $newsize;
|
||||
|
||||
my $old_fmt = PVE::JSONSchema::format_size($oldsize);
|
||||
|
Loading…
Reference in New Issue
Block a user