Merge "Give crosvm process a unique name" into main am: 10ca6f99fe
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Virtualization/+/3317033
Change-Id: Ic326d535b95d28614c6979e9b61317e92b08674e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/android/virtmgr/src/crosvm.rs b/android/virtmgr/src/crosvm.rs
index 8e3dde1..c7b22b8 100644
--- a/android/virtmgr/src/crosvm.rs
+++ b/android/virtmgr/src/crosvm.rs
@@ -35,6 +35,7 @@
use std::mem;
use std::num::{NonZeroU16, NonZeroU32};
use std::os::unix::io::{AsRawFd, OwnedFd};
+use std::os::unix::process::CommandExt;
use std::os::unix::process::ExitStatusExt;
use std::path::{Path, PathBuf};
use std::process::{Command, ExitStatus};
@@ -942,6 +943,9 @@
validate_config(&config)?;
let mut command = Command::new(CROSVM_PATH);
+
+ let vm_name = "crosvm_".to_owned() + &config.name;
+ command.arg0(vm_name.clone());
// TODO(qwandor): Remove --disable-sandbox.
command
.arg("--extended-status")
@@ -950,6 +954,8 @@
.arg("--log-level")
.arg("info,disk=warn")
.arg("run")
+ .arg("--name")
+ .arg(vm_name)
.arg("--disable-sandbox")
.arg("--cid")
.arg(config.cid.to_string());