1 | /* AUTOMATICALLY GENERATED, DO NOT MODIFY */ |
2 | |
3 | /* |
4 | * Schema-defined QAPI types |
5 | * |
6 | * Copyright IBM, Corp. 2011 |
7 | * Copyright (c) 2013-2018 Red Hat Inc. |
8 | * |
9 | * This work is licensed under the terms of the GNU LGPL, version 2.1 or later. |
10 | * See the COPYING.LIB file in the top-level directory. |
11 | */ |
12 | |
13 | #ifndef QAPI_TYPES_RUN_STATE_H |
14 | #define QAPI_TYPES_RUN_STATE_H |
15 | |
16 | #include "qapi/qapi-builtin-types.h" |
17 | |
18 | typedef enum RunState { |
19 | RUN_STATE_DEBUG, |
20 | RUN_STATE_INMIGRATE, |
21 | RUN_STATE_INTERNAL_ERROR, |
22 | RUN_STATE_IO_ERROR, |
23 | RUN_STATE_PAUSED, |
24 | RUN_STATE_POSTMIGRATE, |
25 | RUN_STATE_PRELAUNCH, |
26 | RUN_STATE_FINISH_MIGRATE, |
27 | RUN_STATE_RESTORE_VM, |
28 | RUN_STATE_RUNNING, |
29 | RUN_STATE_SAVE_VM, |
30 | RUN_STATE_SHUTDOWN, |
31 | RUN_STATE_SUSPENDED, |
32 | RUN_STATE_WATCHDOG, |
33 | RUN_STATE_GUEST_PANICKED, |
34 | RUN_STATE_COLO, |
35 | RUN_STATE_PRECONFIG, |
36 | RUN_STATE__MAX, |
37 | } RunState; |
38 | |
39 | #define RunState_str(val) \ |
40 | qapi_enum_lookup(&RunState_lookup, (val)) |
41 | |
42 | extern const QEnumLookup RunState_lookup; |
43 | |
44 | typedef enum ShutdownCause { |
45 | SHUTDOWN_CAUSE_NONE, |
46 | SHUTDOWN_CAUSE_HOST_ERROR, |
47 | SHUTDOWN_CAUSE_HOST_QMP_QUIT, |
48 | SHUTDOWN_CAUSE_HOST_QMP_SYSTEM_RESET, |
49 | SHUTDOWN_CAUSE_HOST_SIGNAL, |
50 | SHUTDOWN_CAUSE_HOST_UI, |
51 | SHUTDOWN_CAUSE_GUEST_SHUTDOWN, |
52 | SHUTDOWN_CAUSE_GUEST_RESET, |
53 | SHUTDOWN_CAUSE_GUEST_PANIC, |
54 | SHUTDOWN_CAUSE_SUBSYSTEM_RESET, |
55 | SHUTDOWN_CAUSE__MAX, |
56 | } ShutdownCause; |
57 | |
58 | #define ShutdownCause_str(val) \ |
59 | qapi_enum_lookup(&ShutdownCause_lookup, (val)) |
60 | |
61 | extern const QEnumLookup ShutdownCause_lookup; |
62 | |
63 | typedef struct StatusInfo StatusInfo; |
64 | |
65 | typedef struct q_obj_SHUTDOWN_arg q_obj_SHUTDOWN_arg; |
66 | |
67 | typedef struct q_obj_RESET_arg q_obj_RESET_arg; |
68 | |
69 | typedef struct q_obj_WATCHDOG_arg q_obj_WATCHDOG_arg; |
70 | |
71 | typedef enum WatchdogAction { |
72 | WATCHDOG_ACTION_RESET, |
73 | WATCHDOG_ACTION_SHUTDOWN, |
74 | WATCHDOG_ACTION_POWEROFF, |
75 | WATCHDOG_ACTION_PAUSE, |
76 | WATCHDOG_ACTION_DEBUG, |
77 | WATCHDOG_ACTION_NONE, |
78 | WATCHDOG_ACTION_INJECT_NMI, |
79 | WATCHDOG_ACTION__MAX, |
80 | } WatchdogAction; |
81 | |
82 | #define WatchdogAction_str(val) \ |
83 | qapi_enum_lookup(&WatchdogAction_lookup, (val)) |
84 | |
85 | extern const QEnumLookup WatchdogAction_lookup; |
86 | |
87 | typedef struct q_obj_watchdog_set_action_arg q_obj_watchdog_set_action_arg; |
88 | |
89 | typedef struct q_obj_GUEST_PANICKED_arg q_obj_GUEST_PANICKED_arg; |
90 | |
91 | typedef enum GuestPanicAction { |
92 | GUEST_PANIC_ACTION_PAUSE, |
93 | GUEST_PANIC_ACTION_POWEROFF, |
94 | GUEST_PANIC_ACTION__MAX, |
95 | } GuestPanicAction; |
96 | |
97 | #define GuestPanicAction_str(val) \ |
98 | qapi_enum_lookup(&GuestPanicAction_lookup, (val)) |
99 | |
100 | extern const QEnumLookup GuestPanicAction_lookup; |
101 | |
102 | typedef enum GuestPanicInformationType { |
103 | GUEST_PANIC_INFORMATION_TYPE_HYPER_V, |
104 | GUEST_PANIC_INFORMATION_TYPE_S390, |
105 | GUEST_PANIC_INFORMATION_TYPE__MAX, |
106 | } GuestPanicInformationType; |
107 | |
108 | #define GuestPanicInformationType_str(val) \ |
109 | qapi_enum_lookup(&GuestPanicInformationType_lookup, (val)) |
110 | |
111 | extern const QEnumLookup GuestPanicInformationType_lookup; |
112 | |
113 | typedef struct q_obj_GuestPanicInformation_base q_obj_GuestPanicInformation_base; |
114 | |
115 | typedef struct GuestPanicInformation GuestPanicInformation; |
116 | |
117 | typedef struct GuestPanicInformationHyperV GuestPanicInformationHyperV; |
118 | |
119 | typedef enum S390CrashReason { |
120 | S390_CRASH_REASON_UNKNOWN, |
121 | S390_CRASH_REASON_DISABLED_WAIT, |
122 | S390_CRASH_REASON_EXTINT_LOOP, |
123 | S390_CRASH_REASON_PGMINT_LOOP, |
124 | S390_CRASH_REASON_OPINT_LOOP, |
125 | S390_CRASH_REASON__MAX, |
126 | } S390CrashReason; |
127 | |
128 | #define S390CrashReason_str(val) \ |
129 | qapi_enum_lookup(&S390CrashReason_lookup, (val)) |
130 | |
131 | extern const QEnumLookup S390CrashReason_lookup; |
132 | |
133 | typedef struct GuestPanicInformationS390 GuestPanicInformationS390; |
134 | |
135 | struct StatusInfo { |
136 | bool running; |
137 | bool singlestep; |
138 | RunState status; |
139 | }; |
140 | |
141 | void qapi_free_StatusInfo(StatusInfo *obj); |
142 | |
143 | struct q_obj_SHUTDOWN_arg { |
144 | bool guest; |
145 | ShutdownCause reason; |
146 | }; |
147 | |
148 | struct q_obj_RESET_arg { |
149 | bool guest; |
150 | ShutdownCause reason; |
151 | }; |
152 | |
153 | struct q_obj_WATCHDOG_arg { |
154 | WatchdogAction action; |
155 | }; |
156 | |
157 | struct q_obj_watchdog_set_action_arg { |
158 | WatchdogAction action; |
159 | }; |
160 | |
161 | struct q_obj_GUEST_PANICKED_arg { |
162 | GuestPanicAction action; |
163 | bool has_info; |
164 | GuestPanicInformation *info; |
165 | }; |
166 | |
167 | struct q_obj_GuestPanicInformation_base { |
168 | GuestPanicInformationType type; |
169 | }; |
170 | |
171 | struct GuestPanicInformationHyperV { |
172 | uint64_t arg1; |
173 | uint64_t arg2; |
174 | uint64_t arg3; |
175 | uint64_t arg4; |
176 | uint64_t arg5; |
177 | }; |
178 | |
179 | struct GuestPanicInformationS390 { |
180 | uint32_t core; |
181 | uint64_t psw_mask; |
182 | uint64_t psw_addr; |
183 | S390CrashReason reason; |
184 | }; |
185 | |
186 | struct GuestPanicInformation { |
187 | GuestPanicInformationType type; |
188 | union { /* union tag is @type */ |
189 | GuestPanicInformationHyperV hyper_v; |
190 | GuestPanicInformationS390 s390; |
191 | } u; |
192 | }; |
193 | |
194 | void qapi_free_GuestPanicInformation(GuestPanicInformation *obj); |
195 | |
196 | void qapi_free_GuestPanicInformationHyperV(GuestPanicInformationHyperV *obj); |
197 | |
198 | void qapi_free_GuestPanicInformationS390(GuestPanicInformationS390 *obj); |
199 | |
200 | #endif /* QAPI_TYPES_RUN_STATE_H */ |
201 | |