vmm: Support resizing memory up to and including hotplug size

The start address after the hottplugged memory can be the start address of
device area.

Fixes: #1803

Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
Bo Chen 2020-10-07 21:23:14 -07:00 committed by Sebastien Boeuf
parent f639a8a0fd
commit 789ee7b3e4

View File

@ -1015,8 +1015,7 @@ impl MemoryManager {
let start_addr = MemoryManager::start_addr(self.guest_memory.memory().last_addr(), true);
if start_addr.checked_add(size.try_into().unwrap()).unwrap() >= self.start_of_device_area()
{
if start_addr.checked_add(size.try_into().unwrap()).unwrap() > self.start_of_device_area() {
return Err(Error::InsufficientHotplugRAM);
}