Add DeathReason::CRASH and ERROR.
crosvm now distinguishes crashes from reboots. ERROR is for a crosvm
error, usually meaning it failed to start the VM in the first place.
Also reorder reasons into a more logical order for future expansion.
Bug: 211704107
Test: atest VirtualizationTestCases
Test: Manually ran some VMs
Change-Id: I1903f05eb3783bdd9c5f09bcbdea473d69fbef42
diff --git a/vm/src/run.rs b/vm/src/run.rs
index d558add..6a0fc15 100644
--- a/vm/src/run.rs
+++ b/vm/src/run.rs
@@ -293,11 +293,13 @@
self.dead.raise();
match reason {
- DeathReason::SHUTDOWN => println!("VM shutdown cleanly."),
- DeathReason::REBOOT => println!("VM tried to reboot, possibly due to a kernel panic."),
+ DeathReason::INFRASTRUCTURE_ERROR => println!("Error waiting for VM to finish."),
DeathReason::KILLED => println!("VM was killed."),
DeathReason::UNKNOWN => println!("VM died for an unknown reason."),
- DeathReason::INFRASTRUCTURE_ERROR => println!("Error waiting for VM to finish."),
+ DeathReason::SHUTDOWN => println!("VM shutdown cleanly."),
+ DeathReason::ERROR => println!("Error starting VM."),
+ DeathReason::REBOOT => println!("VM tried to reboot, possibly due to a kernel panic."),
+ DeathReason::CRASH => println!("VM crashed."),
_ => println!("VM died for an unrecognised reason."),
}
Ok(())