From 10f380f95bc1b613b0735dbe75fdc4ca9f4da816 Mon Sep 17 00:00:00 2001 From: Bo Chen Date: Fri, 9 Oct 2020 16:26:58 -0700 Subject: [PATCH] vmm: Report no error when resizing to current memory size with ACPI We now try to create a ram region of size 0 when the requested memory size is the same as current memory size. It results in an error of `GuestMemoryRegion(Mmap(Os { code: 22, kind: InvalidInput, message: "Invalid argument" }))`. This error is not meaningful to users and we should not report it. Signed-off-by: Bo Chen --- vmm/src/memory_manager.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vmm/src/memory_manager.rs b/vmm/src/memory_manager.rs index 87d510231..826575596 100644 --- a/vmm/src/memory_manager.rs +++ b/vmm/src/memory_manager.rs @@ -1265,7 +1265,7 @@ impl MemoryManager { } } HotplugMethod::Acpi => { - if desired_ram >= self.current_ram { + if desired_ram > self.current_ram { region = Some(self.hotplug_ram_region((desired_ram - self.current_ram) as usize)?); self.current_ram = desired_ram;