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 <chen.bo@intel.com>
This commit is contained in:
Bo Chen 2020-10-09 16:26:58 -07:00 committed by Sebastien Boeuf
parent 299e83bf43
commit 10f380f95b

View File

@ -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;