xref: /openbmc/qemu/qapi/run-state.json (revision dc5bd18f)
1# -*- Mode: Python -*-
2#
3
4##
5# = VM run state
6##
7
8##
9# @RunState:
10#
11# An enumeration of VM run states.
12#
13# @debug: QEMU is running on a debugger
14#
15# @finish-migrate: guest is paused to finish the migration process
16#
17# @inmigrate: guest is paused waiting for an incoming migration.  Note
18# that this state does not tell whether the machine will start at the
19# end of the migration.  This depends on the command-line -S option and
20# any invocation of 'stop' or 'cont' that has happened since QEMU was
21# started.
22#
23# @internal-error: An internal error that prevents further guest execution
24# has occurred
25#
26# @io-error: the last IOP has failed and the device is configured to pause
27# on I/O errors
28#
29# @paused: guest has been paused via the 'stop' command
30#
31# @postmigrate: guest is paused following a successful 'migrate'
32#
33# @prelaunch: QEMU was started with -S and guest has not started
34#
35# @restore-vm: guest is paused to restore VM state
36#
37# @running: guest is actively running
38#
39# @save-vm: guest is paused to save the VM state
40#
41# @shutdown: guest is shut down (and -no-shutdown is in use)
42#
43# @suspended: guest is suspended (ACPI S3)
44#
45# @watchdog: the watchdog action is configured to pause and has been triggered
46#
47# @guest-panicked: guest has been panicked as a result of guest OS panic
48#
49# @colo: guest is paused to save/restore VM state under colo checkpoint,
50#        VM can not get into this state unless colo capability is enabled
51#        for migration. (since 2.8)
52##
53{ 'enum': 'RunState',
54  'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused',
55            'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm',
56            'running', 'save-vm', 'shutdown', 'suspended', 'watchdog',
57            'guest-panicked', 'colo' ] }
58
59##
60# @StatusInfo:
61#
62# Information about VCPU run state
63#
64# @running: true if all VCPUs are runnable, false if not runnable
65#
66# @singlestep: true if VCPUs are in single-step mode
67#
68# @status: the virtual machine @RunState
69#
70# Since:  0.14.0
71#
72# Notes: @singlestep is enabled through the GDB stub
73##
74{ 'struct': 'StatusInfo',
75  'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
76
77##
78# @query-status:
79#
80# Query the run status of all VCPUs
81#
82# Returns: @StatusInfo reflecting all VCPUs
83#
84# Since:  0.14.0
85#
86# Example:
87#
88# -> { "execute": "query-status" }
89# <- { "return": { "running": true,
90#                  "singlestep": false,
91#                  "status": "running" } }
92#
93##
94{ 'command': 'query-status', 'returns': 'StatusInfo' }
95
96##
97# @SHUTDOWN:
98#
99# Emitted when the virtual machine has shut down, indicating that qemu is
100# about to exit.
101#
102# @guest: If true, the shutdown was triggered by a guest request (such as
103# a guest-initiated ACPI shutdown request or other hardware-specific action)
104# rather than a host request (such as sending qemu a SIGINT). (since 2.10)
105#
106# Note: If the command-line option "-no-shutdown" has been specified, qemu will
107# not exit, and a STOP event will eventually follow the SHUTDOWN event
108#
109# Since: 0.12.0
110#
111# Example:
112#
113# <- { "event": "SHUTDOWN", "data": { "guest": true },
114#      "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
115#
116##
117{ 'event': 'SHUTDOWN', 'data': { 'guest': 'bool' } }
118
119##
120# @POWERDOWN:
121#
122# Emitted when the virtual machine is powered down through the power control
123# system, such as via ACPI.
124#
125# Since: 0.12.0
126#
127# Example:
128#
129# <- { "event": "POWERDOWN",
130#      "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
131#
132##
133{ 'event': 'POWERDOWN' }
134
135##
136# @RESET:
137#
138# Emitted when the virtual machine is reset
139#
140# @guest: If true, the reset was triggered by a guest request (such as
141# a guest-initiated ACPI reboot request or other hardware-specific action)
142# rather than a host request (such as the QMP command system_reset).
143# (since 2.10)
144#
145# Since: 0.12.0
146#
147# Example:
148#
149# <- { "event": "RESET", "data": { "guest": false },
150#      "timestamp": { "seconds": 1267041653, "microseconds": 9518 } }
151#
152##
153{ 'event': 'RESET', 'data': { 'guest': 'bool' } }
154
155##
156# @STOP:
157#
158# Emitted when the virtual machine is stopped
159#
160# Since: 0.12.0
161#
162# Example:
163#
164# <- { "event": "STOP",
165#      "timestamp": { "seconds": 1267041730, "microseconds": 281295 } }
166#
167##
168{ 'event': 'STOP' }
169
170##
171# @RESUME:
172#
173# Emitted when the virtual machine resumes execution
174#
175# Since: 0.12.0
176#
177# Example:
178#
179# <- { "event": "RESUME",
180#      "timestamp": { "seconds": 1271770767, "microseconds": 582542 } }
181#
182##
183{ 'event': 'RESUME' }
184
185##
186# @SUSPEND:
187#
188# Emitted when guest enters a hardware suspension state, for example, S3 state,
189# which is sometimes called standby state
190#
191# Since: 1.1
192#
193# Example:
194#
195# <- { "event": "SUSPEND",
196#      "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
197#
198##
199{ 'event': 'SUSPEND' }
200
201##
202# @SUSPEND_DISK:
203#
204# Emitted when guest enters a hardware suspension state with data saved on
205# disk, for example, S4 state, which is sometimes called hibernate state
206#
207# Note: QEMU shuts down (similar to event @SHUTDOWN) when entering this state
208#
209# Since: 1.2
210#
211# Example:
212#
213# <-   { "event": "SUSPEND_DISK",
214#        "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
215#
216##
217{ 'event': 'SUSPEND_DISK' }
218
219##
220# @WAKEUP:
221#
222# Emitted when the guest has woken up from suspend state and is running
223#
224# Since: 1.1
225#
226# Example:
227#
228# <- { "event": "WAKEUP",
229#      "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
230#
231##
232{ 'event': 'WAKEUP' }
233
234##
235# @WATCHDOG:
236#
237# Emitted when the watchdog device's timer is expired
238#
239# @action: action that has been taken
240#
241# Note: If action is "reset", "shutdown", or "pause" the WATCHDOG event is
242# followed respectively by the RESET, SHUTDOWN, or STOP events
243#
244# Note: This event is rate-limited.
245#
246# Since: 0.13.0
247#
248# Example:
249#
250# <- { "event": "WATCHDOG",
251#      "data": { "action": "reset" },
252#      "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
253#
254##
255{ 'event': 'WATCHDOG',
256  'data': { 'action': 'WatchdogAction' } }
257
258##
259# @WatchdogAction:
260#
261# An enumeration of the actions taken when the watchdog device's timer is
262# expired
263#
264# @reset: system resets
265#
266# @shutdown: system shutdown, note that it is similar to @powerdown, which
267#            tries to set to system status and notify guest
268#
269# @poweroff: system poweroff, the emulator program exits
270#
271# @pause: system pauses, similar to @stop
272#
273# @debug: system enters debug state
274#
275# @none: nothing is done
276#
277# @inject-nmi: a non-maskable interrupt is injected into the first VCPU (all
278#              VCPUS on x86) (since 2.4)
279#
280# Since: 2.1
281##
282{ 'enum': 'WatchdogAction',
283  'data': [ 'reset', 'shutdown', 'poweroff', 'pause', 'debug', 'none',
284            'inject-nmi' ] }
285
286##
287# @watchdog-set-action:
288#
289# Set watchdog action
290#
291# Since: 2.11
292##
293{ 'command': 'watchdog-set-action', 'data' : {'action': 'WatchdogAction'} }
294
295##
296# @GUEST_PANICKED:
297#
298# Emitted when guest OS panic is detected
299#
300# @action: action that has been taken, currently always "pause"
301#
302# @info: information about a panic (since 2.9)
303#
304# Since: 1.5
305#
306# Example:
307#
308# <- { "event": "GUEST_PANICKED",
309#      "data": { "action": "pause" } }
310#
311##
312{ 'event': 'GUEST_PANICKED',
313  'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } }
314
315##
316# @GuestPanicAction:
317#
318# An enumeration of the actions taken when guest OS panic is detected
319#
320# @pause: system pauses
321#
322# Since: 2.1 (poweroff since 2.8)
323##
324{ 'enum': 'GuestPanicAction',
325  'data': [ 'pause', 'poweroff' ] }
326
327##
328# @GuestPanicInformationType:
329#
330# An enumeration of the guest panic information types
331#
332# @hyper-v: hyper-v guest panic information type
333#
334# @s390: s390 guest panic information type (Since: 2.12)
335#
336# Since: 2.9
337##
338{ 'enum': 'GuestPanicInformationType',
339  'data': [ 'hyper-v', 's390' ] }
340
341##
342# @GuestPanicInformation:
343#
344# Information about a guest panic
345#
346# @type: Crash type that defines the hypervisor specific information
347#
348# Since: 2.9
349##
350{'union': 'GuestPanicInformation',
351 'base': {'type': 'GuestPanicInformationType'},
352 'discriminator': 'type',
353 'data': { 'hyper-v': 'GuestPanicInformationHyperV',
354           's390': 'GuestPanicInformationS390' } }
355
356##
357# @GuestPanicInformationHyperV:
358#
359# Hyper-V specific guest panic information (HV crash MSRs)
360#
361# Since: 2.9
362##
363{'struct': 'GuestPanicInformationHyperV',
364 'data': { 'arg1': 'uint64',
365           'arg2': 'uint64',
366           'arg3': 'uint64',
367           'arg4': 'uint64',
368           'arg5': 'uint64' } }
369
370##
371# @S390CrashReason:
372#
373# Reason why the CPU is in a crashed state.
374#
375# @unknown: no crash reason was set
376#
377# @disabled-wait: the CPU has entered a disabled wait state
378#
379# @extint-loop: clock comparator or cpu timer interrupt with new PSW enabled
380#              for external interrupts
381#
382# @pgmint-loop: program interrupt with BAD new PSW
383#
384# @opint-loop: operation exception interrupt with invalid code at the program
385#             interrupt new PSW
386#
387# Since: 2.12
388##
389{ 'enum': 'S390CrashReason',
390  'data': [ 'unknown',
391            'disabled-wait',
392            'extint-loop',
393            'pgmint-loop',
394            'opint-loop' ] }
395
396##
397# @GuestPanicInformationS390:
398#
399# S390 specific guest panic information (PSW)
400#
401# @core: core id of the CPU that crashed
402# @psw-mask: control fields of guest PSW
403# @psw-addr: guest instruction address
404# @reason: guest crash reason
405#
406# Since: 2.12
407##
408{'struct': 'GuestPanicInformationS390',
409 'data': { 'core': 'uint32',
410           'psw-mask': 'uint64',
411           'psw-addr': 'uint64',
412           'reason': 'S390CrashReason' } }
413