Merge "Enable crosvm balloon device based on new system property"
diff --git a/virtualizationservice/src/crosvm.rs b/virtualizationservice/src/crosvm.rs
index 76e18db..85a57c9 100644
--- a/virtualizationservice/src/crosvm.rs
+++ b/virtualizationservice/src/crosvm.rs
@@ -24,6 +24,7 @@
use semver::{Version, VersionReq};
use nix::{fcntl::OFlag, unistd::pipe2};
use regex::{Captures, Regex};
+use rustutils::system_properties;
use shared_child::SharedChild;
use std::borrow::Cow;
use std::cmp::max;
@@ -590,10 +591,15 @@
.arg("info,disk=off")
.arg("run")
.arg("--disable-sandbox")
- .arg("--no-balloon")
.arg("--cid")
.arg(config.cid.to_string());
+ if system_properties::read_bool("hypervisor.memory_reclaim.supported", false)? {
+ command.arg("--balloon-page-reporting");
+ } else {
+ command.arg("--no-balloon");
+ }
+
if config.protected {
command.arg("--protected-vm");