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:
@@ -2309,8 +2309,11 @@ impl DeviceManager {
|
||||
let id = String::from(BALLOON_DEVICE_NAME);
|
||||
|
||||
let virtio_balloon_device = Arc::new(Mutex::new(
|
||||
virtio_devices::Balloon::new(id.clone())
|
||||
.map_err(DeviceManagerError::CreateVirtioBalloon)?,
|
||||
virtio_devices::Balloon::new(
|
||||
id.clone(),
|
||||
self.config.lock().unwrap().memory.balloon_size,
|
||||
)
|
||||
.map_err(DeviceManagerError::CreateVirtioBalloon)?,
|
||||
));
|
||||
|
||||
self.memory_manager
|
||||
|
||||
Reference in New Issue
Block a user