1 /*
2  * Copyright 2022 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package android.system.virtualizationcommon;
17 
18 /**
19  * The reason why a VM died.
20  */
21 @Backing(type="int")
22 enum DeathReason {
23     /** There was an error waiting for the VM. */
24     INFRASTRUCTURE_ERROR = 0,
25     /** The VM was killed. */
26     KILLED = 1,
27     /** The VM died for an unknown reason. */
28     UNKNOWN = 2,
29     /** The VM requested to shut down. */
30     SHUTDOWN = 3,
31     /** crosvm had an error starting the VM. */
32     START_FAILED = 4,
33     /** The VM requested to reboot, possibly as the result of a kernel panic. */
34     REBOOT = 5,
35     /** The VM or crosvm crashed. */
36     CRASH = 6,
37     /** The pVM firmware failed to verify the VM because the public key doesn't match. */
38     PVM_FIRMWARE_PUBLIC_KEY_MISMATCH = 7,
39     /** The pVM firmware failed to verify the VM because the instance image changed. */
40     PVM_FIRMWARE_INSTANCE_IMAGE_CHANGED = 8,
41     // 9 & 10 intentionally removed.
42     /** The microdroid failed to connect to VirtualizationService's RPC server. */
43     MICRODROID_FAILED_TO_CONNECT_TO_VIRTUALIZATION_SERVICE = 11,
44     /** The payload for microdroid is changed. */
45     MICRODROID_PAYLOAD_HAS_CHANGED = 12,
46     /** The microdroid failed to verify given payload APK. */
47     MICRODROID_PAYLOAD_VERIFICATION_FAILED = 13,
48     /** The VM config for microdroid is invalid (e.g. missing tasks). */
49     MICRODROID_INVALID_PAYLOAD_CONFIG = 14,
50     /** There was a runtime error while running microdroid manager. */
51     MICRODROID_UNKNOWN_RUNTIME_ERROR = 15,
52     /** The VM killed due to hangup */
53     HANGUP = 16,
54     /** The VCPU stalled */
55     WATCHDOG_REBOOT = 17,
56 }
57