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:
Hui Zhu
2020-08-25 14:44:21 +08:00
committed by Sebastien Boeuf
parent 9dffc5da5c
commit c75f8b2f89
8 changed files with 93 additions and 8 deletions

View File

@@ -1493,6 +1493,11 @@ impl Vm {
Ok(())
}
/// Gets the actual size of the balloon.
pub fn get_balloon_actual(&self) -> u64 {
self.memory_manager.lock().unwrap().get_balloon_actual()
}
}
impl Pausable for Vm {