Align size to 1 KiB bytes before doing 'qmp block_resize'

1. Avoids the error
"VM 111 qmp command 'block_resize' failed - The new size must be a multiple of 512"
for qcow2 disks.
2. Because volume_import expects disk sizes to be a multiple of 1 KiB.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
Fabian Ebner 2020-02-19 11:31:30 +01:00 committed by Thomas Lamprecht
parent 1249d579ea
commit 375db731f7

View File

@ -4656,6 +4656,9 @@ sub qemu_block_resize {
return if !$running;
my $padding = (1024 - $size % 1024) % 1024;
$size = $size + $padding;
mon_cmd($vmid, "block_resize", device => $deviceid, size => int($size));
}