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 <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2020-01-10 16:16:29 +00:00 committed by Samuel Ortiz
parent 4e414f0d84
commit 28c6652e57

View File

@ -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(())