virtmgr: fail fast on misconfigured device
If the device does not advertise support for protected or
non-protected VMs, but still has the virt APEX installed, then that's
bad.
Fail fast to make this as noticeable as possible, and avoid wasting
resources, rather than waiting for things to go wrong later on.
While I'm here: make sure we consistently say "non-protected" rather
than "unprotected".
Bug: 254599807
Test: manual - fake property read, observe obvious failure
Test: atest MicrodroidTests MicrodroidHostTests
Change-Id: Ia0629f2d5b2094f6c1c41ff0fc3f2a76e285f0d7
diff --git a/vm/src/main.rs b/vm/src/main.rs
index 9fa805e..f70ce54 100644
--- a/vm/src/main.rs
+++ b/vm/src/main.rs
@@ -358,15 +358,15 @@
/// Print information about supported VM types.
fn command_info() -> Result<(), Error> {
- let unprotected_vm_supported =
+ let non_protected_vm_supported =
system_properties::read_bool("ro.boot.hypervisor.vm.supported", false)?;
let protected_vm_supported =
system_properties::read_bool("ro.boot.hypervisor.protected_vm.supported", false)?;
- match (unprotected_vm_supported, protected_vm_supported) {
+ match (non_protected_vm_supported, protected_vm_supported) {
(false, false) => println!("VMs are not supported."),
(false, true) => println!("Only protected VMs are supported."),
- (true, false) => println!("Only unprotected VMs are supported."),
- (true, true) => println!("Both protected and unprotected VMs are supported."),
+ (true, false) => println!("Only non-protected VMs are supported."),
+ (true, true) => println!("Both protected and non-protected VMs are supported."),
}
if let Some(version) = system_properties::read("ro.boot.hypervisor.version")? {