virtio-balloon: add deflate_on_oom support

Sometimes we need balloon deflate automatically to give memory
back to guest, especially for some low priority guest processes
under memory pressure. Enable deflate_on_oom to support this.

Usage: --balloon "size=0,deflate_on_oom=on" \

Signed-off-by: Fei Li <lifei.shirley@bytedance.com>
This commit is contained in:
Fei Li
2021-01-21 19:22:29 +08:00
committed by Sebastien Boeuf
parent a6fe4aa7e9
commit aa27f0e743
4 changed files with 34 additions and 4 deletions
+1
View File
@@ -2610,6 +2610,7 @@ impl DeviceManager {
virtio_devices::Balloon::new(
id.clone(),
balloon_config.size,
balloon_config.deflate_on_oom,
self.seccomp_action.clone(),
)
.map_err(DeviceManagerError::CreateVirtioBalloon)?,