Give a better name to STOP_REASON_ERROR
It indicates crosvm failed to start the VM, so
STOP_REASON_START_FAILED.
Slightly gratuitously I also renamed the internal DeathReason - mainly
because this is just a much clearer name.
I didn't change the statslog version, because that would just be too
complicated.
Bug: 261037705
Test: atest MicrodroidTests
Change-Id: I5effdba86ea49ff919d82810926fb14ccbbd8499
diff --git a/virtualizationservice/aidl/android/system/virtualizationservice/DeathReason.aidl b/virtualizationservice/aidl/android/system/virtualizationservice/DeathReason.aidl
index 416eb7b..0980630 100644
--- a/virtualizationservice/aidl/android/system/virtualizationservice/DeathReason.aidl
+++ b/virtualizationservice/aidl/android/system/virtualizationservice/DeathReason.aidl
@@ -29,7 +29,7 @@
/** The VM requested to shut down. */
SHUTDOWN = 3,
/** crosvm had an error starting the VM. */
- ERROR = 4,
+ START_FAILED = 4,
/** The VM requested to reboot, possibly as the result of a kernel panic. */
REBOOT = 5,
/** The VM or crosvm crashed. */
diff --git a/virtualizationservice/src/atom.rs b/virtualizationservice/src/atom.rs
index 9c74d1e..85e37af 100644
--- a/virtualizationservice/src/atom.rs
+++ b/virtualizationservice/src/atom.rs
@@ -182,7 +182,7 @@
DeathReason::KILLED => vm_exited::DeathReason::Killed,
DeathReason::UNKNOWN => vm_exited::DeathReason::Unknown,
DeathReason::SHUTDOWN => vm_exited::DeathReason::Shutdown,
- DeathReason::ERROR => vm_exited::DeathReason::Error,
+ DeathReason::START_FAILED => vm_exited::DeathReason::Error,
DeathReason::REBOOT => vm_exited::DeathReason::Reboot,
DeathReason::CRASH => vm_exited::DeathReason::Crash,
DeathReason::PVM_FIRMWARE_PUBLIC_KEY_MISMATCH => {
diff --git a/virtualizationservice/src/crosvm.rs b/virtualizationservice/src/crosvm.rs
index 0fdc293..406054c 100644
--- a/virtualizationservice/src/crosvm.rs
+++ b/virtualizationservice/src/crosvm.rs
@@ -62,7 +62,7 @@
const CROSVM_PLATFORM_VERSION: &str = "1.0.0";
/// The exit status which crosvm returns when it has an error starting a VM.
-const CROSVM_ERROR_STATUS: i32 = 1;
+const CROSVM_START_ERROR_STATUS: i32 = 1;
/// The exit status which crosvm returns when a VM requests a reboot.
const CROSVM_REBOOT_STATUS: i32 = 32;
/// The exit status which crosvm returns when it crashes due to an error.
@@ -637,7 +637,7 @@
match status.code() {
None => DeathReason::KILLED,
Some(0) => DeathReason::SHUTDOWN,
- Some(CROSVM_ERROR_STATUS) => DeathReason::ERROR,
+ Some(CROSVM_START_ERROR_STATUS) => DeathReason::START_FAILED,
Some(CROSVM_REBOOT_STATUS) => DeathReason::REBOOT,
Some(CROSVM_CRASH_STATUS) => DeathReason::CRASH,
Some(CROSVM_WATCHDOG_REBOOT_STATUS) => DeathReason::WATCHDOG_REBOOT,