]> Git Repo - qemu.git/commitdiff
exec: round up size on MR resize
authorMichael S. Tsirkin <[email protected]>
Tue, 17 Feb 2015 09:15:30 +0000 (10:15 +0100)
committerMichael S. Tsirkin <[email protected]>
Thu, 26 Feb 2015 11:42:20 +0000 (12:42 +0100)
Block size must fundamentally be a multiple of target page size.
Aligning automatically removes need to worry about the alignment
from callers.

Note: the only caller of qemu_ram_resize (acpi) already happens to have
size padded to a power of 2, but we would like to drop the padding in
ACPI core, and don't want to expose target page size knowledge to ACPI.

Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Paolo Bonzini <[email protected]>
exec.c

diff --git a/exec.c b/exec.c
index c85321a38ba69b07ccc6cceaf1545cc087172d36..6a5adab50220e78b024051cc566f79cddf29fbbd 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -1347,6 +1347,8 @@ int qemu_ram_resize(ram_addr_t base, ram_addr_t newsize, Error **errp)
 
     assert(block);
 
+    newsize = TARGET_PAGE_ALIGN(newsize);
+
     if (block->used_length == newsize) {
         return 0;
     }
This page took 0.030288 seconds and 4 git commands to generate.