mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-balloon: Store the balloon size to support reboot
This commit store balloon size to MemoryConfig. After reboot, virtio-balloon can use this size to inflate back to the size before reboot. Signed-off-by: Hui Zhu <teawater@antfin.com>
This commit is contained in:
@@ -738,7 +738,10 @@ impl Vm {
|
||||
}
|
||||
|
||||
if let Some(desired_ram_w_balloon) = desired_ram_w_balloon {
|
||||
self.memory_manager
|
||||
// update the configuration value for the balloon size to ensure
|
||||
// a reboot would use the right value.
|
||||
self.config.lock().unwrap().memory.balloon_size = self
|
||||
.memory_manager
|
||||
.lock()
|
||||
.unwrap()
|
||||
.balloon_resize(desired_ram_w_balloon)
|
||||
|
||||
Reference in New Issue
Block a user