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
18typedef 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
42extern const QEnumLookup RunState_lookup;
43
44typedef 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
61extern const QEnumLookup ShutdownCause_lookup;
62
63typedef struct StatusInfo StatusInfo;
64
65typedef struct q_obj_SHUTDOWN_arg q_obj_SHUTDOWN_arg;
66
67typedef struct q_obj_RESET_arg q_obj_RESET_arg;
68
69typedef struct q_obj_WATCHDOG_arg q_obj_WATCHDOG_arg;
70
71typedef 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
85extern const QEnumLookup WatchdogAction_lookup;
86
87typedef struct q_obj_watchdog_set_action_arg q_obj_watchdog_set_action_arg;
88
89typedef struct q_obj_GUEST_PANICKED_arg q_obj_GUEST_PANICKED_arg;
90
91typedef 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
100extern const QEnumLookup GuestPanicAction_lookup;
101
102typedef 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
111extern const QEnumLookup GuestPanicInformationType_lookup;
112
113typedef struct q_obj_GuestPanicInformation_base q_obj_GuestPanicInformation_base;
114
115typedef struct GuestPanicInformation GuestPanicInformation;
116
117typedef struct GuestPanicInformationHyperV GuestPanicInformationHyperV;
118
119typedef 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
131extern const QEnumLookup S390CrashReason_lookup;
132
133typedef struct GuestPanicInformationS390 GuestPanicInformationS390;
134
135struct StatusInfo {
136 bool running;
137 bool singlestep;
138 RunState status;
139};
140
141void qapi_free_StatusInfo(StatusInfo *obj);
142
143struct q_obj_SHUTDOWN_arg {
144 bool guest;
145 ShutdownCause reason;
146};
147
148struct q_obj_RESET_arg {
149 bool guest;
150 ShutdownCause reason;
151};
152
153struct q_obj_WATCHDOG_arg {
154 WatchdogAction action;
155};
156
157struct q_obj_watchdog_set_action_arg {
158 WatchdogAction action;
159};
160
161struct q_obj_GUEST_PANICKED_arg {
162 GuestPanicAction action;
163 bool has_info;
164 GuestPanicInformation *info;
165};
166
167struct q_obj_GuestPanicInformation_base {
168 GuestPanicInformationType type;
169};
170
171struct GuestPanicInformationHyperV {
172 uint64_t arg1;
173 uint64_t arg2;
174 uint64_t arg3;
175 uint64_t arg4;
176 uint64_t arg5;
177};
178
179struct GuestPanicInformationS390 {
180 uint32_t core;
181 uint64_t psw_mask;
182 uint64_t psw_addr;
183 S390CrashReason reason;
184};
185
186struct GuestPanicInformation {
187 GuestPanicInformationType type;
188 union { /* union tag is @type */
189 GuestPanicInformationHyperV hyper_v;
190 GuestPanicInformationS390 s390;
191 } u;
192};
193
194void qapi_free_GuestPanicInformation(GuestPanicInformation *obj);
195
196void qapi_free_GuestPanicInformationHyperV(GuestPanicInformationHyperV *obj);
197
198void qapi_free_GuestPanicInformationS390(GuestPanicInformationS390 *obj);
199
200#endif /* QAPI_TYPES_RUN_STATE_H */
201