mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: memory_actual_size reflects hotplug state
It is desirable to be able to track the progress of memory hotplug. Update the memory_actual_size field to query the current plugged size from virtio-mem to enable this. Signed-off-by: Jared White <git@jaredwhite.dev>
This commit is contained in:
+3
-1
@@ -1915,9 +1915,11 @@ impl RequestHandler for Vmm {
|
||||
};
|
||||
let config = vm_config.lock().unwrap().clone();
|
||||
|
||||
let mut memory_actual_size = config.memory.total_size();
|
||||
let mut memory_actual_size =
|
||||
config.memory.total_size() - config.memory.hotplugged_size();
|
||||
if let Some(vm) = &self.vm {
|
||||
memory_actual_size = memory_actual_size.saturating_sub(vm.balloon_size());
|
||||
memory_actual_size += vm.virtio_mem_plugged_size();
|
||||
}
|
||||
|
||||
let device_tree = self
|
||||
|
||||
Reference in New Issue
Block a user