From 28c6652e5706ddea3dabe588530ea80eb5f21184 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Fri, 10 Jan 2020 16:16:29 +0000 Subject: [PATCH] vmm: Upon VmResize attempt to hotplug the memory If a new amount of RAM is requested in the VmResize command try and hotplug if it an increase (MemoryManager::Resize() silently ignores decreases.) Signed-off-by: Rob Bradford --- vmm/src/vm.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vmm/src/vm.rs b/vmm/src/vm.rs index e6f6a7399..0ec5cf19a 100755 --- a/vmm/src/vm.rs +++ b/vmm/src/vm.rs @@ -497,6 +497,14 @@ impl Vm { } if let Some(desired_memory) = desired_memory { + self.memory_manager + .lock() + .unwrap() + .resize(desired_memory) + .map_err(Error::MemoryManager)?; + self.devices + .notify_hotplug(HotPlugNotificationType::MemoryDevicesChanged) + .map_err(Error::DeviceManager)?; self.config.lock().unwrap().memory.size = desired_memory; } Ok(())