]> Git Repo - qemu.git/blame - qapi/run-state.json
qmp: Add reason to SHUTDOWN and RESET events
[qemu.git] / qapi / run-state.json
CommitLineData
0e201d34
MA
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)
8a36283e
IM
52# @preconfig: QEMU is paused before board specific init callback is executed.
53# The state is reachable only if the --preconfig CLI option is used.
54# (Since 3.0)
0e201d34
MA
55##
56{ 'enum': 'RunState',
57 'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused',
58 'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm',
59 'running', 'save-vm', 'shutdown', 'suspended', 'watchdog',
8a36283e 60 'guest-panicked', 'colo', 'preconfig' ] }
0e201d34 61
d43013e2
DC
62##
63# @ShutdownCause:
64#
65# An enumeration of reasons for a Shutdown.
66#
67# @none: No shutdown request pending
68#
69# @host-error: An error prevents further use of guest
70#
71# @host-qmp: Reaction to a QMP command, like 'quit'
72#
73# @host-signal: Reaction to a signal, such as SIGINT
74#
75# @host-ui: Reaction to a UI event, like window close
76#
77# @guest-shutdown: Guest shutdown/suspend request, via ACPI or other
78# hardware-specific means
79#
80# @guest-reset: Guest reset request, and command line turns that into
81# a shutdown
82#
83# @guest-panic: Guest panicked, and command line turns that into a shutdown
84#
85# @subsystem-reset: Partial guest reset that does not trigger QMP events and
86# ignores --no-reboot. This is useful for sanitizing
87# hypercalls on s390 that are used during kexec/kdump/boot
88#
89##
90{ 'enum': 'ShutdownCause',
91 # Beware, shutdown_caused_by_guest() depends on enumeration order
92 'data': [ 'none', 'host-error', 'host-qmp', 'host-signal', 'host-ui',
93 'guest-shutdown', 'guest-reset', 'guest-panic',
94 'subsystem-reset'] }
95
0e201d34
MA
96##
97# @StatusInfo:
98#
99# Information about VCPU run state
100#
101# @running: true if all VCPUs are runnable, false if not runnable
102#
103# @singlestep: true if VCPUs are in single-step mode
104#
105# @status: the virtual machine @RunState
106#
107# Since: 0.14.0
108#
109# Notes: @singlestep is enabled through the GDB stub
110##
111{ 'struct': 'StatusInfo',
112 'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
113
114##
115# @query-status:
116#
117# Query the run status of all VCPUs
118#
119# Returns: @StatusInfo reflecting all VCPUs
120#
121# Since: 0.14.0
122#
123# Example:
124#
125# -> { "execute": "query-status" }
126# <- { "return": { "running": true,
127# "singlestep": false,
128# "status": "running" } }
129#
130##
d6fe3d02
IM
131{ 'command': 'query-status', 'returns': 'StatusInfo',
132 'allow-preconfig': true }
0e201d34
MA
133
134##
135# @SHUTDOWN:
136#
137# Emitted when the virtual machine has shut down, indicating that qemu is
138# about to exit.
139#
140# @guest: If true, the shutdown was triggered by a guest request (such as
141# a guest-initiated ACPI shutdown request or other hardware-specific action)
142# rather than a host request (such as sending qemu a SIGINT). (since 2.10)
143#
ecd7a0d5
DC
144# @reason: The @ShutdownCause which resulted in the SHUTDOWN. (since 4.0)
145#
0e201d34
MA
146# Note: If the command-line option "-no-shutdown" has been specified, qemu will
147# not exit, and a STOP event will eventually follow the SHUTDOWN event
148#
149# Since: 0.12.0
150#
151# Example:
152#
153# <- { "event": "SHUTDOWN", "data": { "guest": true },
154# "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
155#
156##
ecd7a0d5 157{ 'event': 'SHUTDOWN', 'data': { 'guest': 'bool', 'reason': 'ShutdownCause' } }
0e201d34
MA
158
159##
160# @POWERDOWN:
161#
162# Emitted when the virtual machine is powered down through the power control
163# system, such as via ACPI.
164#
165# Since: 0.12.0
166#
167# Example:
168#
169# <- { "event": "POWERDOWN",
170# "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
171#
172##
173{ 'event': 'POWERDOWN' }
174
175##
176# @RESET:
177#
178# Emitted when the virtual machine is reset
179#
180# @guest: If true, the reset was triggered by a guest request (such as
181# a guest-initiated ACPI reboot request or other hardware-specific action)
182# rather than a host request (such as the QMP command system_reset).
183# (since 2.10)
184#
ecd7a0d5
DC
185# @reason: The @ShutdownCause of the RESET. (since 4.0)
186#
0e201d34
MA
187# Since: 0.12.0
188#
189# Example:
190#
191# <- { "event": "RESET", "data": { "guest": false },
192# "timestamp": { "seconds": 1267041653, "microseconds": 9518 } }
193#
194##
ecd7a0d5 195{ 'event': 'RESET', 'data': { 'guest': 'bool', 'reason': 'ShutdownCause' } }
0e201d34
MA
196
197##
198# @STOP:
199#
200# Emitted when the virtual machine is stopped
201#
202# Since: 0.12.0
203#
204# Example:
205#
206# <- { "event": "STOP",
207# "timestamp": { "seconds": 1267041730, "microseconds": 281295 } }
208#
209##
210{ 'event': 'STOP' }
211
212##
213# @RESUME:
214#
215# Emitted when the virtual machine resumes execution
216#
217# Since: 0.12.0
218#
219# Example:
220#
221# <- { "event": "RESUME",
222# "timestamp": { "seconds": 1271770767, "microseconds": 582542 } }
223#
224##
225{ 'event': 'RESUME' }
226
227##
228# @SUSPEND:
229#
230# Emitted when guest enters a hardware suspension state, for example, S3 state,
231# which is sometimes called standby state
232#
233# Since: 1.1
234#
235# Example:
236#
237# <- { "event": "SUSPEND",
238# "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
239#
240##
241{ 'event': 'SUSPEND' }
242
243##
244# @SUSPEND_DISK:
245#
246# Emitted when guest enters a hardware suspension state with data saved on
247# disk, for example, S4 state, which is sometimes called hibernate state
248#
249# Note: QEMU shuts down (similar to event @SHUTDOWN) when entering this state
250#
251# Since: 1.2
252#
253# Example:
254#
255# <- { "event": "SUSPEND_DISK",
256# "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
257#
258##
259{ 'event': 'SUSPEND_DISK' }
260
261##
262# @WAKEUP:
263#
264# Emitted when the guest has woken up from suspend state and is running
265#
266# Since: 1.1
267#
268# Example:
269#
270# <- { "event": "WAKEUP",
271# "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
272#
273##
274{ 'event': 'WAKEUP' }
275
276##
277# @WATCHDOG:
278#
279# Emitted when the watchdog device's timer is expired
280#
281# @action: action that has been taken
282#
283# Note: If action is "reset", "shutdown", or "pause" the WATCHDOG event is
284# followed respectively by the RESET, SHUTDOWN, or STOP events
285#
286# Note: This event is rate-limited.
287#
288# Since: 0.13.0
289#
290# Example:
291#
292# <- { "event": "WATCHDOG",
293# "data": { "action": "reset" },
294# "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
295#
296##
297{ 'event': 'WATCHDOG',
14d53b4f 298 'data': { 'action': 'WatchdogAction' } }
0e201d34
MA
299
300##
14d53b4f 301# @WatchdogAction:
0e201d34
MA
302#
303# An enumeration of the actions taken when the watchdog device's timer is
304# expired
305#
306# @reset: system resets
307#
308# @shutdown: system shutdown, note that it is similar to @powerdown, which
309# tries to set to system status and notify guest
310#
311# @poweroff: system poweroff, the emulator program exits
312#
313# @pause: system pauses, similar to @stop
314#
315# @debug: system enters debug state
316#
317# @none: nothing is done
318#
319# @inject-nmi: a non-maskable interrupt is injected into the first VCPU (all
320# VCPUS on x86) (since 2.4)
321#
322# Since: 2.1
323##
14d53b4f 324{ 'enum': 'WatchdogAction',
0e201d34
MA
325 'data': [ 'reset', 'shutdown', 'poweroff', 'pause', 'debug', 'none',
326 'inject-nmi' ] }
327
3da7a416
EB
328##
329# @watchdog-set-action:
330#
331# Set watchdog action
332#
333# Since: 2.11
334##
335{ 'command': 'watchdog-set-action', 'data' : {'action': 'WatchdogAction'} }
336
0e201d34
MA
337##
338# @GUEST_PANICKED:
339#
340# Emitted when guest OS panic is detected
341#
342# @action: action that has been taken, currently always "pause"
343#
344# @info: information about a panic (since 2.9)
345#
346# Since: 1.5
347#
348# Example:
349#
350# <- { "event": "GUEST_PANICKED",
351# "data": { "action": "pause" } }
352#
353##
354{ 'event': 'GUEST_PANICKED',
355 'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } }
356
357##
358# @GuestPanicAction:
359#
360# An enumeration of the actions taken when guest OS panic is detected
361#
362# @pause: system pauses
363#
364# Since: 2.1 (poweroff since 2.8)
365##
366{ 'enum': 'GuestPanicAction',
367 'data': [ 'pause', 'poweroff' ] }
368
369##
370# @GuestPanicInformationType:
371#
372# An enumeration of the guest panic information types
373#
4ada99ad
CB
374# @hyper-v: hyper-v guest panic information type
375#
376# @s390: s390 guest panic information type (Since: 2.12)
377#
0e201d34
MA
378# Since: 2.9
379##
380{ 'enum': 'GuestPanicInformationType',
4ada99ad 381 'data': [ 'hyper-v', 's390' ] }
0e201d34
MA
382
383##
384# @GuestPanicInformation:
385#
386# Information about a guest panic
387#
4ada99ad
CB
388# @type: Crash type that defines the hypervisor specific information
389#
0e201d34
MA
390# Since: 2.9
391##
392{'union': 'GuestPanicInformation',
393 'base': {'type': 'GuestPanicInformationType'},
394 'discriminator': 'type',
4ada99ad
CB
395 'data': { 'hyper-v': 'GuestPanicInformationHyperV',
396 's390': 'GuestPanicInformationS390' } }
0e201d34
MA
397
398##
399# @GuestPanicInformationHyperV:
400#
401# Hyper-V specific guest panic information (HV crash MSRs)
402#
403# Since: 2.9
404##
405{'struct': 'GuestPanicInformationHyperV',
406 'data': { 'arg1': 'uint64',
407 'arg2': 'uint64',
408 'arg3': 'uint64',
409 'arg4': 'uint64',
410 'arg5': 'uint64' } }
4ada99ad
CB
411
412##
413# @S390CrashReason:
414#
415# Reason why the CPU is in a crashed state.
416#
417# @unknown: no crash reason was set
418#
419# @disabled-wait: the CPU has entered a disabled wait state
420#
421# @extint-loop: clock comparator or cpu timer interrupt with new PSW enabled
422# for external interrupts
423#
424# @pgmint-loop: program interrupt with BAD new PSW
425#
426# @opint-loop: operation exception interrupt with invalid code at the program
427# interrupt new PSW
428#
429# Since: 2.12
430##
431{ 'enum': 'S390CrashReason',
432 'data': [ 'unknown',
433 'disabled-wait',
434 'extint-loop',
435 'pgmint-loop',
436 'opint-loop' ] }
437
438##
439# @GuestPanicInformationS390:
440#
441# S390 specific guest panic information (PSW)
442#
443# @core: core id of the CPU that crashed
444# @psw-mask: control fields of guest PSW
445# @psw-addr: guest instruction address
446# @reason: guest crash reason
447#
448# Since: 2.12
449##
450{'struct': 'GuestPanicInformationS390',
451 'data': { 'core': 'uint32',
452 'psw-mask': 'uint64',
453 'psw-addr': 'uint64',
454 'reason': 'S390CrashReason' } }
This page took 0.168426 seconds and 4 git commands to generate.