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

Backports commit 129ddaf31be583fb7c97812e07e028661005ce42 from qemu
This commit is contained in:
Michael S. Tsirkin 2018-02-18 19:02:19 -05:00 committed by Lioncash
parent 024ec1755e
commit 1cc51e4b53
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -1033,6 +1033,8 @@ int qemu_ram_resize(struct uc_struct *uc, ram_addr_t base, ram_addr_t newsize, E
assert(block);
newsize = TARGET_PAGE_ALIGN(newsize);
if (block->used_length == newsize) {
return 0;
}