mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-03 01:29:13 +00:00
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:
parent
1249d579ea
commit
375db731f7
@ -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));
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user