From: Michael S. Tsirkin Date: Tue, 17 Feb 2015 09:15:30 +0000 (+0100) Subject: exec: round up size on MR resize X-Git-Tag: v2.3.0-rc0~34^2~103 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=129ddaf31be583fb7c97812e07e028661005ce42;p=thirdparty%2Fqemu.git exec: round up size on MR resize 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 Acked-by: Paolo Bonzini --- diff --git a/exec.c b/exec.c index c85321a38ba..6a5adab5022 100644 --- 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; }