From 789ee7b3e4fcc11568970c655b8f2bc193fc0544 Mon Sep 17 00:00:00 2001 From: Bo Chen Date: Wed, 7 Oct 2020 21:23:14 -0700 Subject: [PATCH] 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 --- vmm/src/memory_manager.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vmm/src/memory_manager.rs b/vmm/src/memory_manager.rs index f9a909074..87d510231 100644 --- a/vmm/src/memory_manager.rs +++ b/vmm/src/memory_manager.rs @@ -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); }