mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-balloon: Add memory_actual_size to vm.info to show memory actual size
The virtio-balloon change the memory size is asynchronous. VirtioBalloonConfig.actual of balloon device show current balloon size. This commit add memory_actual_size to vm.info to show memory actual size. Signed-off-by: Hui Zhu <teawater@antfin.com>
This commit is contained in:
@@ -1236,6 +1236,14 @@ impl MemoryManager {
|
||||
Ok(balloon_size)
|
||||
}
|
||||
|
||||
pub fn get_balloon_actual(&self) -> u64 {
|
||||
if let Some(balloon) = &self.balloon {
|
||||
return balloon.lock().unwrap().get_actual();
|
||||
}
|
||||
|
||||
0
|
||||
}
|
||||
|
||||
/// In case this function resulted in adding a new memory region to the
|
||||
/// guest memory, the new region is returned to the caller. The virtio-mem
|
||||
/// use case never adds a new region as the whole hotpluggable memory has
|
||||
|
||||
Reference in New Issue
Block a user