Add an option to start a pVM without pvmfw
This can be useful when debugging issues related to early boot of pVMs.
Note: this option is only available for debugging and requires `adb
root`.
Bug: 376870129
Test: adb shell 'setprop hypervisor.pvmfw.path none
Test: adb shell /apex/com.android.virt/bin/vm run-microdroid -p
Change-Id: I61074fbec5df3dcd7b6273586f491c32d810cc70
diff --git a/android/virtmgr/src/crosvm.rs b/android/virtmgr/src/crosvm.rs
index b28834a..94379a9 100644
--- a/android/virtmgr/src/crosvm.rs
+++ b/android/virtmgr/src/crosvm.rs
@@ -975,7 +975,11 @@
if config.protected {
match system_properties::read(SYSPROP_CUSTOM_PVMFW_PATH)? {
Some(pvmfw_path) if !pvmfw_path.is_empty() => {
- command.arg("--protected-vm-with-firmware").arg(pvmfw_path)
+ if pvmfw_path == "none" {
+ command.arg("--protected-vm-without-firmware")
+ } else {
+ command.arg("--protected-vm-with-firmware").arg(pvmfw_path)
+ }
}
_ => command.arg("--protected-vm"),
};