blob: ce95cfa46b73a52622d7ab85e8200f2c7552225e [file] [log] [blame]
Markus Armbruster0e201d32017-08-24 21:13:57 +02001# -*- Mode: Python -*-
Andrea Bolognanif7160f32020-07-29 20:50:24 +02002# vim: filetype=python
Markus Armbruster0e201d32017-08-24 21:13:57 +02003#
4
5##
6# = VM run state
7##
8
9##
10# @RunState:
11#
12# An enumeration of VM run states.
13#
14# @debug: QEMU is running on a debugger
15#
16# @finish-migrate: guest is paused to finish the migration process
17#
18# @inmigrate: guest is paused waiting for an incoming migration. Note
Markus Armbrustera937b6a2023-04-28 12:54:29 +020019# that this state does not tell whether the machine will start at
20# the end of the migration. This depends on the command-line -S
21# option and any invocation of 'stop' or 'cont' that has happened
22# since QEMU was started.
Markus Armbruster0e201d32017-08-24 21:13:57 +020023#
Markus Armbrustera937b6a2023-04-28 12:54:29 +020024# @internal-error: An internal error that prevents further guest
25# execution has occurred
Markus Armbruster0e201d32017-08-24 21:13:57 +020026#
Markus Armbrustera937b6a2023-04-28 12:54:29 +020027# @io-error: the last IOP has failed and the device is configured to
28# pause on I/O errors
Markus Armbruster0e201d32017-08-24 21:13:57 +020029#
30# @paused: guest has been paused via the 'stop' command
31#
32# @postmigrate: guest is paused following a successful 'migrate'
33#
34# @prelaunch: QEMU was started with -S and guest has not started
35#
36# @restore-vm: guest is paused to restore VM state
37#
38# @running: guest is actively running
39#
40# @save-vm: guest is paused to save the VM state
41#
42# @shutdown: guest is shut down (and -no-shutdown is in use)
43#
44# @suspended: guest is suspended (ACPI S3)
45#
Markus Armbrustera937b6a2023-04-28 12:54:29 +020046# @watchdog: the watchdog action is configured to pause and has been
47# triggered
Markus Armbruster0e201d32017-08-24 21:13:57 +020048#
Markus Armbrustera937b6a2023-04-28 12:54:29 +020049# @guest-panicked: guest has been panicked as a result of guest OS
50# panic
Markus Armbruster0e201d32017-08-24 21:13:57 +020051#
Markus Armbrustera937b6a2023-04-28 12:54:29 +020052# @colo: guest is paused to save/restore VM state under colo
53# checkpoint, VM can not get into this state unless colo
54# capability is enabled for migration. (since 2.8)
Markus Armbruster0e201d32017-08-24 21:13:57 +020055##
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',
Paolo Bonzini164dafd2020-10-27 04:44:18 -040060 'guest-panicked', 'colo' ] }
Markus Armbruster0e201d32017-08-24 21:13:57 +020061
62##
Dominik Csapakd43013e2018-12-05 12:01:29 +010063# @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#
Dominik Csapak92548932018-12-05 12:01:31 +010071# @host-qmp-quit: Reaction to the QMP command 'quit'
72#
73# @host-qmp-system-reset: Reaction to the QMP command 'system_reset'
Dominik Csapakd43013e2018-12-05 12:01:29 +010074#
75# @host-signal: Reaction to a signal, such as SIGINT
76#
77# @host-ui: Reaction to a UI event, like window close
78#
79# @guest-shutdown: Guest shutdown/suspend request, via ACPI or other
Markus Armbrustera937b6a2023-04-28 12:54:29 +020080# hardware-specific means
Dominik Csapakd43013e2018-12-05 12:01:29 +010081#
82# @guest-reset: Guest reset request, and command line turns that into
Markus Armbrustera937b6a2023-04-28 12:54:29 +020083# a shutdown
Dominik Csapakd43013e2018-12-05 12:01:29 +010084#
Markus Armbrustera937b6a2023-04-28 12:54:29 +020085# @guest-panic: Guest panicked, and command line turns that into a
86# shutdown
Dominik Csapakd43013e2018-12-05 12:01:29 +010087#
Markus Armbrustera937b6a2023-04-28 12:54:29 +020088# @subsystem-reset: Partial guest reset that does not trigger QMP
89# events and ignores --no-reboot. This is useful for sanitizing
90# hypercalls on s390 that are used during kexec/kdump/boot
Dominik Csapakd43013e2018-12-05 12:01:29 +010091#
Jason A. Donenfeld7966d702022-10-25 02:43:17 +020092# @snapshot-load: A snapshot is being loaded by the record & replay
Markus Armbrustera937b6a2023-04-28 12:54:29 +020093# subsystem. This value is used only within QEMU. It doesn't
Markus Armbruster5305a4e2024-03-22 15:09:09 +010094# occur in QMP. (since 7.2)
Dominik Csapakd43013e2018-12-05 12:01:29 +010095##
96{ 'enum': 'ShutdownCause',
97 # Beware, shutdown_caused_by_guest() depends on enumeration order
Dominik Csapak92548932018-12-05 12:01:31 +010098 'data': [ 'none', 'host-error', 'host-qmp-quit', 'host-qmp-system-reset',
99 'host-signal', 'host-ui', 'guest-shutdown', 'guest-reset',
Jason A. Donenfeld7966d702022-10-25 02:43:17 +0200100 'guest-panic', 'subsystem-reset', 'snapshot-load'] }
Dominik Csapakd43013e2018-12-05 12:01:29 +0100101
102##
Markus Armbruster0e201d32017-08-24 21:13:57 +0200103# @StatusInfo:
104#
Steve Sistareb9ae4732024-01-03 12:05:31 -0800105# Information about VM run state
Markus Armbruster0e201d32017-08-24 21:13:57 +0200106#
107# @running: true if all VCPUs are runnable, false if not runnable
108#
Markus Armbruster0e201d32017-08-24 21:13:57 +0200109# @status: the virtual machine @RunState
110#
Andrea Bolognani23e46452022-05-03 09:37:35 +0200111# Since: 0.14
Markus Armbruster0e201d32017-08-24 21:13:57 +0200112##
113{ 'struct': 'StatusInfo',
Peter Maydell34c18202023-04-17 17:40:41 +0100114 'data': {'running': 'bool',
Peter Maydell34c18202023-04-17 17:40:41 +0100115 'status': 'RunState'} }
Markus Armbruster0e201d32017-08-24 21:13:57 +0200116
117##
118# @query-status:
119#
Steve Sistareb9ae4732024-01-03 12:05:31 -0800120# Query the run status of the VM
Markus Armbruster0e201d32017-08-24 21:13:57 +0200121#
Steve Sistareb9ae4732024-01-03 12:05:31 -0800122# Returns: @StatusInfo reflecting the VM
Markus Armbruster0e201d32017-08-24 21:13:57 +0200123#
Andrea Bolognani23e46452022-05-03 09:37:35 +0200124# Since: 0.14
Markus Armbruster0e201d32017-08-24 21:13:57 +0200125#
John Snow14b48aa2024-07-16 22:13:08 -0400126# .. qmp-example::
Markus Armbruster0e201d32017-08-24 21:13:57 +0200127#
Markus Armbrusterd23055b2024-02-16 15:58:34 +0100128# -> { "execute": "query-status" }
129# <- { "return": { "running": true,
130# "status": "running" } }
Markus Armbruster0e201d32017-08-24 21:13:57 +0200131##
Igor Mammedovd6fe3d02018-05-11 18:51:43 +0200132{ 'command': 'query-status', 'returns': 'StatusInfo',
133 'allow-preconfig': true }
Markus Armbruster0e201d32017-08-24 21:13:57 +0200134
135##
136# @SHUTDOWN:
137#
Markus Armbrustera937b6a2023-04-28 12:54:29 +0200138# Emitted when the virtual machine has shut down, indicating that qemu
139# is about to exit.
Markus Armbruster0e201d32017-08-24 21:13:57 +0200140#
Markus Armbrustera937b6a2023-04-28 12:54:29 +0200141# @guest: If true, the shutdown was triggered by a guest request (such
142# as a guest-initiated ACPI shutdown request or other
143# hardware-specific action) rather than a host request (such as
Markus Armbruster5305a4e2024-03-22 15:09:09 +0100144# sending qemu a SIGINT). (since 2.10)
Markus Armbruster0e201d32017-08-24 21:13:57 +0200145#
Markus Armbruster209e64d2024-03-22 15:09:08 +0100146# @reason: The @ShutdownCause which resulted in the SHUTDOWN.
147# (since 4.0)
Dominik Csapakecd7a0d2018-12-05 12:01:30 +0100148#
John Snow543ff132024-06-26 18:21:18 -0400149# .. note:: If the command-line option ``-no-shutdown`` has been
John Snowd461c272024-06-26 18:21:16 -0400150# specified, qemu will not exit, and a STOP event will eventually
151# follow the SHUTDOWN event.
Markus Armbruster0e201d32017-08-24 21:13:57 +0200152#
Markus Armbruster9bc6e892020-11-18 07:41:58 +0100153# Since: 0.12
Markus Armbruster0e201d32017-08-24 21:13:57 +0200154#
John Snow14b48aa2024-07-16 22:13:08 -0400155# .. qmp-example::
Markus Armbruster0e201d32017-08-24 21:13:57 +0200156#
Markus Armbrusterd23055b2024-02-16 15:58:34 +0100157# <- { "event": "SHUTDOWN",
158# "data": { "guest": true, "reason": "guest-shutdown" },
159# "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
Markus Armbruster0e201d32017-08-24 21:13:57 +0200160##
Dominik Csapakecd7a0d2018-12-05 12:01:30 +0100161{ 'event': 'SHUTDOWN', 'data': { 'guest': 'bool', 'reason': 'ShutdownCause' } }
Markus Armbruster0e201d32017-08-24 21:13:57 +0200162
163##
164# @POWERDOWN:
165#
Markus Armbrustera937b6a2023-04-28 12:54:29 +0200166# Emitted when the virtual machine is powered down through the power
167# control system, such as via ACPI.
Markus Armbruster0e201d32017-08-24 21:13:57 +0200168#
Markus Armbruster9bc6e892020-11-18 07:41:58 +0100169# Since: 0.12
Markus Armbruster0e201d32017-08-24 21:13:57 +0200170#
John Snow14b48aa2024-07-16 22:13:08 -0400171# .. qmp-example::
Markus Armbruster0e201d32017-08-24 21:13:57 +0200172#
Markus Armbrusterd23055b2024-02-16 15:58:34 +0100173# <- { "event": "POWERDOWN",
174# "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
Markus Armbruster0e201d32017-08-24 21:13:57 +0200175##
176{ 'event': 'POWERDOWN' }
177
178##
179# @RESET:
180#
181# Emitted when the virtual machine is reset
182#
183# @guest: If true, the reset was triggered by a guest request (such as
Markus Armbrustera937b6a2023-04-28 12:54:29 +0200184# a guest-initiated ACPI reboot request or other hardware-specific
185# action) rather than a host request (such as the QMP command
Markus Armbruster5305a4e2024-03-22 15:09:09 +0100186# system_reset). (since 2.10)
Markus Armbruster0e201d32017-08-24 21:13:57 +0200187#
Markus Armbruster5305a4e2024-03-22 15:09:09 +0100188# @reason: The @ShutdownCause of the RESET. (since 4.0)
Dominik Csapakecd7a0d2018-12-05 12:01:30 +0100189#
Markus Armbruster9bc6e892020-11-18 07:41:58 +0100190# Since: 0.12
Markus Armbruster0e201d32017-08-24 21:13:57 +0200191#
John Snow14b48aa2024-07-16 22:13:08 -0400192# .. qmp-example::
Markus Armbruster0e201d32017-08-24 21:13:57 +0200193#
Markus Armbrusterd23055b2024-02-16 15:58:34 +0100194# <- { "event": "RESET",
195# "data": { "guest": false, "reason": "guest-reset" },
196# "timestamp": { "seconds": 1267041653, "microseconds": 9518 } }
Markus Armbruster0e201d32017-08-24 21:13:57 +0200197##
Dominik Csapakecd7a0d2018-12-05 12:01:30 +0100198{ 'event': 'RESET', 'data': { 'guest': 'bool', 'reason': 'ShutdownCause' } }
Markus Armbruster0e201d32017-08-24 21:13:57 +0200199
200##
201# @STOP:
202#
203# Emitted when the virtual machine is stopped
204#
Markus Armbruster9bc6e892020-11-18 07:41:58 +0100205# Since: 0.12
Markus Armbruster0e201d32017-08-24 21:13:57 +0200206#
John Snow14b48aa2024-07-16 22:13:08 -0400207# .. qmp-example::
Markus Armbruster0e201d32017-08-24 21:13:57 +0200208#
Markus Armbrusterd23055b2024-02-16 15:58:34 +0100209# <- { "event": "STOP",
210# "timestamp": { "seconds": 1267041730, "microseconds": 281295 } }
Markus Armbruster0e201d32017-08-24 21:13:57 +0200211##
212{ 'event': 'STOP' }
213
214##
215# @RESUME:
216#
217# Emitted when the virtual machine resumes execution
218#
Markus Armbruster9bc6e892020-11-18 07:41:58 +0100219# Since: 0.12
Markus Armbruster0e201d32017-08-24 21:13:57 +0200220#
John Snow14b48aa2024-07-16 22:13:08 -0400221# .. qmp-example::
Markus Armbruster0e201d32017-08-24 21:13:57 +0200222#
Markus Armbrusterd23055b2024-02-16 15:58:34 +0100223# <- { "event": "RESUME",
224# "timestamp": { "seconds": 1271770767, "microseconds": 582542 } }
Markus Armbruster0e201d32017-08-24 21:13:57 +0200225##
226{ 'event': 'RESUME' }
227
228##
229# @SUSPEND:
230#
Markus Armbrustera937b6a2023-04-28 12:54:29 +0200231# Emitted when guest enters a hardware suspension state, for example,
232# S3 state, which is sometimes called standby state
Markus Armbruster0e201d32017-08-24 21:13:57 +0200233#
234# Since: 1.1
235#
John Snow14b48aa2024-07-16 22:13:08 -0400236# .. qmp-example::
Markus Armbruster0e201d32017-08-24 21:13:57 +0200237#
Markus Armbrusterd23055b2024-02-16 15:58:34 +0100238# <- { "event": "SUSPEND",
239# "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
Markus Armbruster0e201d32017-08-24 21:13:57 +0200240##
241{ 'event': 'SUSPEND' }
242
243##
244# @SUSPEND_DISK:
245#
Markus Armbrustera937b6a2023-04-28 12:54:29 +0200246# Emitted when guest enters a hardware suspension state with data
247# saved on disk, for example, S4 state, which is sometimes called
248# hibernate state
Markus Armbruster0e201d32017-08-24 21:13:57 +0200249#
John Snowd461c272024-06-26 18:21:16 -0400250# .. note:: QEMU shuts down (similar to event @SHUTDOWN) when entering
251# this state.
Markus Armbruster0e201d32017-08-24 21:13:57 +0200252#
253# Since: 1.2
254#
John Snow14b48aa2024-07-16 22:13:08 -0400255# .. qmp-example::
Markus Armbruster0e201d32017-08-24 21:13:57 +0200256#
Markus Armbrusterd23055b2024-02-16 15:58:34 +0100257# <- { "event": "SUSPEND_DISK",
258# "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
Markus Armbruster0e201d32017-08-24 21:13:57 +0200259##
260{ 'event': 'SUSPEND_DISK' }
261
262##
263# @WAKEUP:
264#
Markus Armbrustera937b6a2023-04-28 12:54:29 +0200265# Emitted when the guest has woken up from suspend state and is
266# running
Markus Armbruster0e201d32017-08-24 21:13:57 +0200267#
268# Since: 1.1
269#
John Snow14b48aa2024-07-16 22:13:08 -0400270# .. qmp-example::
Markus Armbruster0e201d32017-08-24 21:13:57 +0200271#
Markus Armbrusterd23055b2024-02-16 15:58:34 +0100272# <- { "event": "WAKEUP",
273# "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
Markus Armbruster0e201d32017-08-24 21:13:57 +0200274##
275{ 'event': 'WAKEUP' }
276
277##
278# @WATCHDOG:
279#
280# Emitted when the watchdog device's timer is expired
281#
282# @action: action that has been taken
283#
John Snowd461c272024-06-26 18:21:16 -0400284# .. note:: If action is "reset", "shutdown", or "pause" the WATCHDOG
285# event is followed respectively by the RESET, SHUTDOWN, or STOP
286# events.
Markus Armbruster0e201d32017-08-24 21:13:57 +0200287#
John Snowd461c272024-06-26 18:21:16 -0400288# .. note:: This event is rate-limited.
Markus Armbruster0e201d32017-08-24 21:13:57 +0200289#
Markus Armbruster9bc6e892020-11-18 07:41:58 +0100290# Since: 0.13
Markus Armbruster0e201d32017-08-24 21:13:57 +0200291#
John Snow14b48aa2024-07-16 22:13:08 -0400292# .. qmp-example::
Markus Armbruster0e201d32017-08-24 21:13:57 +0200293#
Markus Armbrusterd23055b2024-02-16 15:58:34 +0100294# <- { "event": "WATCHDOG",
295# "data": { "action": "reset" },
296# "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
Markus Armbruster0e201d32017-08-24 21:13:57 +0200297##
298{ 'event': 'WATCHDOG',
Michal Privoznik14d53b42017-09-07 10:05:24 +0200299 'data': { 'action': 'WatchdogAction' } }
Markus Armbruster0e201d32017-08-24 21:13:57 +0200300
301##
Michal Privoznik14d53b42017-09-07 10:05:24 +0200302# @WatchdogAction:
Markus Armbruster0e201d32017-08-24 21:13:57 +0200303#
Markus Armbrustera937b6a2023-04-28 12:54:29 +0200304# An enumeration of the actions taken when the watchdog device's timer
305# is expired
Markus Armbruster0e201d32017-08-24 21:13:57 +0200306#
307# @reset: system resets
308#
Markus Armbrustera937b6a2023-04-28 12:54:29 +0200309# @shutdown: system shutdown, note that it is similar to @powerdown,
310# which tries to set to system status and notify guest
Markus Armbruster0e201d32017-08-24 21:13:57 +0200311#
312# @poweroff: system poweroff, the emulator program exits
313#
314# @pause: system pauses, similar to @stop
315#
316# @debug: system enters debug state
317#
318# @none: nothing is done
319#
Markus Armbrustera937b6a2023-04-28 12:54:29 +0200320# @inject-nmi: a non-maskable interrupt is injected into the first
321# VCPU (all VCPUS on x86) (since 2.4)
Markus Armbruster0e201d32017-08-24 21:13:57 +0200322#
323# Since: 2.1
324##
Michal Privoznik14d53b42017-09-07 10:05:24 +0200325{ 'enum': 'WatchdogAction',
Markus Armbruster0e201d32017-08-24 21:13:57 +0200326 'data': [ 'reset', 'shutdown', 'poweroff', 'pause', 'debug', 'none',
327 'inject-nmi' ] }
328
329##
Alejandro Jimeneze6dba042020-12-11 11:52:43 -0500330# @RebootAction:
331#
332# Possible QEMU actions upon guest reboot
333#
Paolo Bonzinic27025e2021-01-20 14:30:27 +0100334# @reset: Reset the VM
Alejandro Jimeneze6dba042020-12-11 11:52:43 -0500335#
Markus Armbrustera937b6a2023-04-28 12:54:29 +0200336# @shutdown: Shutdown the VM and exit, according to the shutdown
337# action
Alejandro Jimeneze6dba042020-12-11 11:52:43 -0500338#
339# Since: 6.0
340##
341{ 'enum': 'RebootAction',
Paolo Bonzinic27025e2021-01-20 14:30:27 +0100342 'data': [ 'reset', 'shutdown' ] }
Alejandro Jimeneze6dba042020-12-11 11:52:43 -0500343
344##
345# @ShutdownAction:
346#
347# Possible QEMU actions upon guest shutdown
348#
349# @poweroff: Shutdown the VM and exit
350#
Andrea Bolognanif39057d2022-05-03 09:37:30 +0200351# @pause: pause the VM
Alejandro Jimeneze6dba042020-12-11 11:52:43 -0500352#
353# Since: 6.0
354##
355{ 'enum': 'ShutdownAction',
356 'data': [ 'poweroff', 'pause' ] }
357
358##
Alejandro Jimenezc753e8e2020-12-11 17:31:52 -0500359# @PanicAction:
360#
361# @none: Continue VM execution
362#
363# @pause: Pause the VM
364#
Markus Armbrustera937b6a2023-04-28 12:54:29 +0200365# @shutdown: Shutdown the VM and exit, according to the shutdown
366# action
Paolo Bonzinic27025e2021-01-20 14:30:27 +0100367#
Markus Armbrustera937b6a2023-04-28 12:54:29 +0200368# @exit-failure: Shutdown the VM and exit with nonzero status (since
369# 7.1)
Ilya Leoshkevich0882caf2022-07-26 00:37:45 +0200370#
Alejandro Jimenezc753e8e2020-12-11 17:31:52 -0500371# Since: 6.0
372##
373{ 'enum': 'PanicAction',
Ilya Leoshkevich0882caf2022-07-26 00:37:45 +0200374 'data': [ 'pause', 'shutdown', 'exit-failure', 'none' ] }
Alejandro Jimenezc753e8e2020-12-11 17:31:52 -0500375
376##
Eric Blake3da7a412018-02-26 16:57:43 -0600377# @watchdog-set-action:
378#
Paolo Bonzinib2913cc2024-03-25 11:45:02 +0100379# Set watchdog action.
380#
381# @action: @WatchdogAction action taken when watchdog timer expires.
Eric Blake3da7a412018-02-26 16:57:43 -0600382#
383# Since: 2.11
Paolo Bonzinib2913cc2024-03-25 11:45:02 +0100384#
John Snow14b48aa2024-07-16 22:13:08 -0400385# .. qmp-example::
Paolo Bonzinib2913cc2024-03-25 11:45:02 +0100386#
387# -> { "execute": "watchdog-set-action",
388# "arguments": { "action": "inject-nmi" } }
389# <- { "return": {} }
Eric Blake3da7a412018-02-26 16:57:43 -0600390##
391{ 'command': 'watchdog-set-action', 'data' : {'action': 'WatchdogAction'} }
392
393##
Alejandro Jimeneze6dba042020-12-11 11:52:43 -0500394# @set-action:
395#
Markus Armbrustera937b6a2023-04-28 12:54:29 +0200396# Set the actions that will be taken by the emulator in response to
397# guest events.
Alejandro Jimeneze6dba042020-12-11 11:52:43 -0500398#
399# @reboot: @RebootAction action taken on guest reboot.
400#
401# @shutdown: @ShutdownAction action taken on guest shutdown.
402#
Alejandro Jimenezc753e8e2020-12-11 17:31:52 -0500403# @panic: @PanicAction action taken on guest panic.
404#
Markus Armbruster53d5c362024-02-27 12:39:13 +0100405# @watchdog: @WatchdogAction action taken when watchdog timer expires.
Alejandro Jimeneze6dba042020-12-11 11:52:43 -0500406#
407# Since: 6.0
408#
John Snow14b48aa2024-07-16 22:13:08 -0400409# .. qmp-example::
Alejandro Jimeneze6dba042020-12-11 11:52:43 -0500410#
Markus Armbrusterd23055b2024-02-16 15:58:34 +0100411# -> { "execute": "set-action",
412# "arguments": { "reboot": "shutdown",
413# "shutdown" : "pause",
414# "panic": "pause",
415# "watchdog": "inject-nmi" } }
416# <- { "return": {} }
Alejandro Jimeneze6dba042020-12-11 11:52:43 -0500417##
418{ 'command': 'set-action',
419 'data': { '*reboot': 'RebootAction',
420 '*shutdown': 'ShutdownAction',
Alejandro Jimenezc753e8e2020-12-11 17:31:52 -0500421 '*panic': 'PanicAction',
Alejandro Jimeneze6dba042020-12-11 11:52:43 -0500422 '*watchdog': 'WatchdogAction' },
423 'allow-preconfig': true }
424
425##
Markus Armbruster0e201d32017-08-24 21:13:57 +0200426# @GUEST_PANICKED:
427#
428# Emitted when guest OS panic is detected
429#
430# @action: action that has been taken, currently always "pause"
431#
432# @info: information about a panic (since 2.9)
433#
434# Since: 1.5
435#
John Snow14b48aa2024-07-16 22:13:08 -0400436# .. qmp-example::
Markus Armbruster0e201d32017-08-24 21:13:57 +0200437#
Markus Armbrusterd23055b2024-02-16 15:58:34 +0100438# <- { "event": "GUEST_PANICKED",
439# "data": { "action": "pause" },
440# "timestamp": { "seconds": 1648245231, "microseconds": 900001 } }
Markus Armbruster0e201d32017-08-24 21:13:57 +0200441##
442{ 'event': 'GUEST_PANICKED',
443 'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } }
444
445##
zhenwei pi7dc58de2020-01-14 10:31:02 +0800446# @GUEST_CRASHLOADED:
447#
448# Emitted when guest OS crash loaded is detected
449#
450# @action: action that has been taken, currently always "run"
451#
452# @info: information about a panic
453#
454# Since: 5.0
455#
John Snow14b48aa2024-07-16 22:13:08 -0400456# .. qmp-example::
zhenwei pi7dc58de2020-01-14 10:31:02 +0800457#
Markus Armbrusterd23055b2024-02-16 15:58:34 +0100458# <- { "event": "GUEST_CRASHLOADED",
459# "data": { "action": "run" },
460# "timestamp": { "seconds": 1648245259, "microseconds": 893771 } }
zhenwei pi7dc58de2020-01-14 10:31:02 +0800461##
462{ 'event': 'GUEST_CRASHLOADED',
463 'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } }
464
465##
Alejandro Jimenez8db1f7b2024-05-27 08:27:52 +0200466# @GUEST_PVSHUTDOWN:
467#
468# Emitted when guest submits a shutdown request via pvpanic interface
469#
470# Since: 9.1
471#
John Snow14b48aa2024-07-16 22:13:08 -0400472# .. qmp-example::
Alejandro Jimenez8db1f7b2024-05-27 08:27:52 +0200473#
474# <- { "event": "GUEST_PVSHUTDOWN",
475# "timestamp": { "seconds": 1648245259, "microseconds": 893771 } }
476##
477{ 'event': 'GUEST_PVSHUTDOWN' }
478
479##
Markus Armbruster0e201d32017-08-24 21:13:57 +0200480# @GuestPanicAction:
481#
482# An enumeration of the actions taken when guest OS panic is detected
483#
484# @pause: system pauses
485#
Markus Armbruster86bf13a2023-04-25 08:42:20 +0200486# @poweroff: system powers off (since 2.8)
487#
488# @run: system continues to run (since 5.0)
489#
490# Since: 2.1
Markus Armbruster0e201d32017-08-24 21:13:57 +0200491##
492{ 'enum': 'GuestPanicAction',
zhenwei pi7dc58de2020-01-14 10:31:02 +0800493 'data': [ 'pause', 'poweroff', 'run' ] }
Markus Armbruster0e201d32017-08-24 21:13:57 +0200494
495##
496# @GuestPanicInformationType:
497#
498# An enumeration of the guest panic information types
499#
Christian Borntraeger4ada99a2018-02-09 12:25:43 +0000500# @hyper-v: hyper-v guest panic information type
501#
502# @s390: s390 guest panic information type (Since: 2.12)
503#
Markus Armbruster0e201d32017-08-24 21:13:57 +0200504# Since: 2.9
505##
506{ 'enum': 'GuestPanicInformationType',
Christian Borntraeger4ada99a2018-02-09 12:25:43 +0000507 'data': [ 'hyper-v', 's390' ] }
Markus Armbruster0e201d32017-08-24 21:13:57 +0200508
509##
510# @GuestPanicInformation:
511#
512# Information about a guest panic
513#
Christian Borntraeger4ada99a2018-02-09 12:25:43 +0000514# @type: Crash type that defines the hypervisor specific information
515#
Markus Armbruster0e201d32017-08-24 21:13:57 +0200516# Since: 2.9
517##
518{'union': 'GuestPanicInformation',
519 'base': {'type': 'GuestPanicInformationType'},
520 'discriminator': 'type',
Markus Armbrustera937b6a2023-04-28 12:54:29 +0200521 'data': {'hyper-v': 'GuestPanicInformationHyperV',
522 's390': 'GuestPanicInformationS390'}}
Markus Armbruster0e201d32017-08-24 21:13:57 +0200523
524##
525# @GuestPanicInformationHyperV:
526#
527# Hyper-V specific guest panic information (HV crash MSRs)
528#
Paolo Bonzinib2913cc2024-03-25 11:45:02 +0100529# @arg1: for Windows, STOP code for the guest crash. For Linux,
Markus Armbruster01bed0f2024-07-29 08:52:20 +0200530# an error code.
Paolo Bonzinib2913cc2024-03-25 11:45:02 +0100531#
532# @arg2: for Windows, first argument of the STOP. For Linux, the
Markus Armbruster01bed0f2024-07-29 08:52:20 +0200533# guest OS ID, which has the kernel version in bits 16-47 and
534# 0x8100 in bits 48-63.
Paolo Bonzinib2913cc2024-03-25 11:45:02 +0100535#
536# @arg3: for Windows, second argument of the STOP. For Linux, the
Markus Armbruster01bed0f2024-07-29 08:52:20 +0200537# program counter of the guest.
Paolo Bonzinib2913cc2024-03-25 11:45:02 +0100538#
539# @arg4: for Windows, third argument of the STOP. For Linux, the
Markus Armbruster01bed0f2024-07-29 08:52:20 +0200540# RAX register (x86) or the stack pointer (aarch64) of the guest.
Paolo Bonzinib2913cc2024-03-25 11:45:02 +0100541#
542# @arg5: for Windows, fourth argument of the STOP. For x86 Linux, the
Markus Armbruster01bed0f2024-07-29 08:52:20 +0200543# stack pointer of the guest.
Paolo Bonzinib2913cc2024-03-25 11:45:02 +0100544#
Markus Armbruster0e201d32017-08-24 21:13:57 +0200545# Since: 2.9
546##
547{'struct': 'GuestPanicInformationHyperV',
Markus Armbrustera937b6a2023-04-28 12:54:29 +0200548 'data': {'arg1': 'uint64',
549 'arg2': 'uint64',
550 'arg3': 'uint64',
551 'arg4': 'uint64',
552 'arg5': 'uint64'}}
Christian Borntraeger4ada99a2018-02-09 12:25:43 +0000553
554##
555# @S390CrashReason:
556#
557# Reason why the CPU is in a crashed state.
558#
559# @unknown: no crash reason was set
560#
561# @disabled-wait: the CPU has entered a disabled wait state
562#
Markus Armbrustera937b6a2023-04-28 12:54:29 +0200563# @extint-loop: clock comparator or cpu timer interrupt with new PSW
564# enabled for external interrupts
Christian Borntraeger4ada99a2018-02-09 12:25:43 +0000565#
566# @pgmint-loop: program interrupt with BAD new PSW
567#
Markus Armbrustera937b6a2023-04-28 12:54:29 +0200568# @opint-loop: operation exception interrupt with invalid code at the
569# program interrupt new PSW
Christian Borntraeger4ada99a2018-02-09 12:25:43 +0000570#
571# Since: 2.12
572##
573{ 'enum': 'S390CrashReason',
574 'data': [ 'unknown',
575 'disabled-wait',
576 'extint-loop',
577 'pgmint-loop',
578 'opint-loop' ] }
579
580##
581# @GuestPanicInformationS390:
582#
583# S390 specific guest panic information (PSW)
584#
585# @core: core id of the CPU that crashed
Markus Armbrustera937b6a2023-04-28 12:54:29 +0200586#
Christian Borntraeger4ada99a2018-02-09 12:25:43 +0000587# @psw-mask: control fields of guest PSW
Markus Armbrustera937b6a2023-04-28 12:54:29 +0200588#
Christian Borntraeger4ada99a2018-02-09 12:25:43 +0000589# @psw-addr: guest instruction address
Markus Armbrustera937b6a2023-04-28 12:54:29 +0200590#
Christian Borntraeger4ada99a2018-02-09 12:25:43 +0000591# @reason: guest crash reason
592#
593# Since: 2.12
594##
595{'struct': 'GuestPanicInformationS390',
Markus Armbrustera937b6a2023-04-28 12:54:29 +0200596 'data': {'core': 'uint32',
597 'psw-mask': 'uint64',
598 'psw-addr': 'uint64',
599 'reason': 'S390CrashReason'}}
zhenwei pi77b285f2020-09-30 18:04:39 +0800600
601##
602# @MEMORY_FAILURE:
603#
604# Emitted when a memory failure occurs on host side.
605#
606# @recipient: recipient is defined as @MemoryFailureRecipient.
607#
Markus Armbruster1e6b0502024-03-22 15:09:07 +0100608# @action: action that has been taken.
zhenwei pi77b285f2020-09-30 18:04:39 +0800609#
Markus Armbruster1e6b0502024-03-22 15:09:07 +0100610# @flags: flags for MemoryFailureAction.
zhenwei pi77b285f2020-09-30 18:04:39 +0800611#
612# Since: 5.2
613#
John Snow14b48aa2024-07-16 22:13:08 -0400614# .. qmp-example::
zhenwei pi77b285f2020-09-30 18:04:39 +0800615#
Markus Armbrusterd23055b2024-02-16 15:58:34 +0100616# <- { "event": "MEMORY_FAILURE",
617# "data": { "recipient": "hypervisor",
618# "action": "fatal",
619# "flags": { "action-required": false,
620# "recursive": false } },
621# "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
zhenwei pi77b285f2020-09-30 18:04:39 +0800622##
623{ 'event': 'MEMORY_FAILURE',
624 'data': { 'recipient': 'MemoryFailureRecipient',
625 'action': 'MemoryFailureAction',
626 'flags': 'MemoryFailureFlags'} }
627
628##
629# @MemoryFailureRecipient:
630#
631# Hardware memory failure occurs, handled by recipient.
632#
Markus Armbrustera937b6a2023-04-28 12:54:29 +0200633# @hypervisor: memory failure at QEMU process address space. (none
634# guest memory, but used by QEMU itself).
zhenwei pi77b285f2020-09-30 18:04:39 +0800635#
636# @guest: memory failure at guest memory,
637#
638# Since: 5.2
zhenwei pi77b285f2020-09-30 18:04:39 +0800639##
640{ 'enum': 'MemoryFailureRecipient',
641 'data': [ 'hypervisor',
642 'guest' ] }
643
zhenwei pi77b285f2020-09-30 18:04:39 +0800644##
645# @MemoryFailureAction:
646#
647# Actions taken by QEMU in response to a hardware memory failure.
648#
Markus Armbrustera937b6a2023-04-28 12:54:29 +0200649# @ignore: the memory failure could be ignored. This will only be the
650# case for action-optional failures.
zhenwei pi77b285f2020-09-30 18:04:39 +0800651#
Markus Armbrustera937b6a2023-04-28 12:54:29 +0200652# @inject: memory failure occurred in guest memory, the guest enabled
653# MCE handling mechanism, and QEMU could inject the MCE into the
654# guest successfully.
zhenwei pi77b285f2020-09-30 18:04:39 +0800655#
Markus Armbrustera937b6a2023-04-28 12:54:29 +0200656# @fatal: the failure is unrecoverable. This occurs for
657# action-required failures if the recipient is the hypervisor;
658# QEMU will exit.
zhenwei pi77b285f2020-09-30 18:04:39 +0800659#
Markus Armbrustera937b6a2023-04-28 12:54:29 +0200660# @reset: the failure is unrecoverable but confined to the guest.
661# This occurs if the recipient is a guest guest which is not ready
662# to handle memory failures.
zhenwei pi77b285f2020-09-30 18:04:39 +0800663#
664# Since: 5.2
zhenwei pi77b285f2020-09-30 18:04:39 +0800665##
666{ 'enum': 'MemoryFailureAction',
667 'data': [ 'ignore',
668 'inject',
669 'fatal',
670 'reset' ] }
671
672##
673# @MemoryFailureFlags:
674#
675# Additional information on memory failures.
676#
677# @action-required: whether a memory failure event is action-required
Markus Armbrustera937b6a2023-04-28 12:54:29 +0200678# or action-optional (e.g. a failure during memory scrub).
zhenwei pi77b285f2020-09-30 18:04:39 +0800679#
Markus Armbrustera937b6a2023-04-28 12:54:29 +0200680# @recursive: whether the failure occurred while the previous failure
681# was still in progress.
zhenwei pi77b285f2020-09-30 18:04:39 +0800682#
683# Since: 5.2
zhenwei pi77b285f2020-09-30 18:04:39 +0800684##
685{ 'struct': 'MemoryFailureFlags',
686 'data': { 'action-required': 'bool',
687 'recursive': 'bool'} }
Chenyi Qiange2e69f62022-09-29 15:20:14 +0800688
689##
690# @NotifyVmexitOption:
691#
692# An enumeration of the options specified when enabling notify VM exit
693#
Markus Armbrustera937b6a2023-04-28 12:54:29 +0200694# @run: enable the feature, do nothing and continue if the notify VM
695# exit happens.
Chenyi Qiange2e69f62022-09-29 15:20:14 +0800696#
Markus Armbrustera937b6a2023-04-28 12:54:29 +0200697# @internal-error: enable the feature, raise a internal error if the
698# notify VM exit happens.
Chenyi Qiange2e69f62022-09-29 15:20:14 +0800699#
700# @disable: disable the feature.
701#
702# Since: 7.2
703##
704{ 'enum': 'NotifyVmexitOption',
Peter Maydellc27f4b62023-04-17 17:40:40 +0100705 'data': [ 'run', 'internal-error', 'disable' ] }