mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-08-23 00:11:16 +00:00
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:
parent
4e414f0d84
commit
28c6652e57
@ -497,6 +497,14 @@ impl Vm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let Some(desired_memory) = desired_memory {
|
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;
|
self.config.lock().unwrap().memory.size = desired_memory;
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
Loading…
Reference in New Issue
Block a user