exec: Fix for qemu_ram_resize() callback
commitce4adc0b6e6167091373389ef8befd379c61fddb
authorDavid Hildenbrand <david@redhat.com>
Fri, 3 Apr 2020 10:18:27 +0000 (3 11:18 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 13 Apr 2020 10:55:54 +0000 (13 06:55 -0400)
tree9ad77918a4d67e924f6a1b3a706ae31385cdd4c1
parent394f0f72fd94595e656af62f079b7680cdbe8add
exec: Fix for qemu_ram_resize() callback

Summarizing the issue:
1. Memory regions contain ram blocks with a different size,  if the
   size is  not properly aligned. While memory regions can have an
   unaligned size, ram blocks can't. This is true when creating
   resizable memory region with  an unaligned size.
2. When resizing a ram block/memory region, the size of the memory
   region  is set to the aligned size. The callback is called with
   the aligned size. The unaligned piece is lost.

Because of the above, if ACPI blob length modifications happens
after the initial virt_acpi_build() call, and the changed blob
length is within the PAGE size boundary, then the revised size
is not seen by the firmware on Guest reboot.

Hence make sure callback is called if memory region size is changed,
irrespective of aligned or not.

Signed-off-by: David Hildenbrand <david@redhat.com>
[Shameer: added commit log]
Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20200403101827.30664-4-shameerali.kolothum.thodi@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
exec.c