]> git.proxmox.com Git - mirror_qemu.git/blame - qapi/run-state.json
Merge tag 'pull-maintainer-may24-160524-2' of https://gitlab.com/stsquad/qemu into...
[mirror_qemu.git] / qapi / run-state.json
CommitLineData
0e201d34 1# -*- Mode: Python -*-
f7160f32 2# vim: filetype=python
0e201d34
MA
3#
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
a937b6aa
MA
19# 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.
0e201d34 23#
a937b6aa
MA
24# @internal-error: An internal error that prevents further guest
25# execution has occurred
0e201d34 26#
a937b6aa
MA
27# @io-error: the last IOP has failed and the device is configured to
28# pause on I/O errors
0e201d34
MA
29#
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#
a937b6aa
MA
46# @watchdog: the watchdog action is configured to pause and has been
47# triggered
0e201d34 48#
a937b6aa
MA
49# @guest-panicked: guest has been panicked as a result of guest OS
50# panic
0e201d34 51#
a937b6aa
MA
52# @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)
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',
164dafd1 60 'guest-panicked', 'colo' ] }
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#
92548938
DC
71# @host-qmp-quit: Reaction to the QMP command 'quit'
72#
73# @host-qmp-system-reset: Reaction to the QMP command 'system_reset'
d43013e2
DC
74#
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
a937b6aa 80# hardware-specific means
d43013e2
DC
81#
82# @guest-reset: Guest reset request, and command line turns that into
a937b6aa 83# a shutdown
d43013e2 84#
a937b6aa
MA
85# @guest-panic: Guest panicked, and command line turns that into a
86# shutdown
d43013e2 87#
a937b6aa
MA
88# @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
d43013e2 91#
7966d70f 92# @snapshot-load: A snapshot is being loaded by the record & replay
a937b6aa 93# subsystem. This value is used only within QEMU. It doesn't
5305a4ee 94# occur in QMP. (since 7.2)
d43013e2
DC
95##
96{ 'enum': 'ShutdownCause',
97 # Beware, shutdown_caused_by_guest() depends on enumeration order
92548938
DC
98 'data': [ 'none', 'host-error', 'host-qmp-quit', 'host-qmp-system-reset',
99 'host-signal', 'host-ui', 'guest-shutdown', 'guest-reset',
7966d70f 100 'guest-panic', 'subsystem-reset', 'snapshot-load'] }
d43013e2 101
0e201d34
MA
102##
103# @StatusInfo:
104#
b9ae473d 105# Information about VM run state
0e201d34
MA
106#
107# @running: true if all VCPUs are runnable, false if not runnable
108#
0e201d34
MA
109# @status: the virtual machine @RunState
110#
23e46452 111# Since: 0.14
0e201d34
MA
112##
113{ 'struct': 'StatusInfo',
34c18203 114 'data': {'running': 'bool',
34c18203 115 'status': 'RunState'} }
0e201d34
MA
116
117##
118# @query-status:
119#
b9ae473d 120# Query the run status of the VM
0e201d34 121#
b9ae473d 122# Returns: @StatusInfo reflecting the VM
0e201d34 123#
23e46452 124# Since: 0.14
0e201d34
MA
125#
126# Example:
127#
d23055b8
MA
128# -> { "execute": "query-status" }
129# <- { "return": { "running": true,
130# "status": "running" } }
0e201d34 131##
d6fe3d02
IM
132{ 'command': 'query-status', 'returns': 'StatusInfo',
133 'allow-preconfig': true }
0e201d34
MA
134
135##
136# @SHUTDOWN:
137#
a937b6aa
MA
138# Emitted when the virtual machine has shut down, indicating that qemu
139# is about to exit.
0e201d34 140#
a937b6aa
MA
141# @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
5305a4ee 144# sending qemu a SIGINT). (since 2.10)
0e201d34 145#
209e64d9
MA
146# @reason: The @ShutdownCause which resulted in the SHUTDOWN.
147# (since 4.0)
ecd7a0d5 148#
a937b6aa
MA
149# Note: If the command-line option "-no-shutdown" has been specified,
150# qemu will not exit, and a STOP event will eventually follow the
151# SHUTDOWN event
0e201d34 152#
9bc6e893 153# Since: 0.12
0e201d34
MA
154#
155# Example:
156#
d23055b8
MA
157# <- { "event": "SHUTDOWN",
158# "data": { "guest": true, "reason": "guest-shutdown" },
159# "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
0e201d34 160##
ecd7a0d5 161{ 'event': 'SHUTDOWN', 'data': { 'guest': 'bool', 'reason': 'ShutdownCause' } }
0e201d34
MA
162
163##
164# @POWERDOWN:
165#
a937b6aa
MA
166# Emitted when the virtual machine is powered down through the power
167# control system, such as via ACPI.
0e201d34 168#
9bc6e893 169# Since: 0.12
0e201d34
MA
170#
171# Example:
172#
d23055b8
MA
173# <- { "event": "POWERDOWN",
174# "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
0e201d34
MA
175##
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
a937b6aa
MA
184# a guest-initiated ACPI reboot request or other hardware-specific
185# action) rather than a host request (such as the QMP command
5305a4ee 186# system_reset). (since 2.10)
0e201d34 187#
5305a4ee 188# @reason: The @ShutdownCause of the RESET. (since 4.0)
ecd7a0d5 189#
9bc6e893 190# Since: 0.12
0e201d34
MA
191#
192# Example:
193#
d23055b8
MA
194# <- { "event": "RESET",
195# "data": { "guest": false, "reason": "guest-reset" },
196# "timestamp": { "seconds": 1267041653, "microseconds": 9518 } }
0e201d34 197##
ecd7a0d5 198{ 'event': 'RESET', 'data': { 'guest': 'bool', 'reason': 'ShutdownCause' } }
0e201d34
MA
199
200##
201# @STOP:
202#
203# Emitted when the virtual machine is stopped
204#
9bc6e893 205# Since: 0.12
0e201d34
MA
206#
207# Example:
208#
d23055b8
MA
209# <- { "event": "STOP",
210# "timestamp": { "seconds": 1267041730, "microseconds": 281295 } }
0e201d34
MA
211##
212{ 'event': 'STOP' }
213
214##
215# @RESUME:
216#
217# Emitted when the virtual machine resumes execution
218#
9bc6e893 219# Since: 0.12
0e201d34
MA
220#
221# Example:
222#
d23055b8
MA
223# <- { "event": "RESUME",
224# "timestamp": { "seconds": 1271770767, "microseconds": 582542 } }
0e201d34
MA
225##
226{ 'event': 'RESUME' }
227
228##
229# @SUSPEND:
230#
a937b6aa
MA
231# Emitted when guest enters a hardware suspension state, for example,
232# S3 state, which is sometimes called standby state
0e201d34
MA
233#
234# Since: 1.1
235#
236# Example:
237#
d23055b8
MA
238# <- { "event": "SUSPEND",
239# "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
0e201d34
MA
240##
241{ 'event': 'SUSPEND' }
242
243##
244# @SUSPEND_DISK:
245#
a937b6aa
MA
246# 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
0e201d34 249#
a937b6aa
MA
250# Note: QEMU shuts down (similar to event @SHUTDOWN) when entering
251# this state
0e201d34
MA
252#
253# Since: 1.2
254#
255# Example:
256#
d23055b8
MA
257# <- { "event": "SUSPEND_DISK",
258# "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
0e201d34
MA
259##
260{ 'event': 'SUSPEND_DISK' }
261
262##
263# @WAKEUP:
264#
a937b6aa
MA
265# Emitted when the guest has woken up from suspend state and is
266# running
0e201d34
MA
267#
268# Since: 1.1
269#
270# Example:
271#
d23055b8
MA
272# <- { "event": "WAKEUP",
273# "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
0e201d34
MA
274##
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#
a937b6aa
MA
284# Note: If action is "reset", "shutdown", or "pause" the WATCHDOG
285# event is followed respectively by the RESET, SHUTDOWN, or STOP
286# events
0e201d34
MA
287#
288# Note: This event is rate-limited.
289#
9bc6e893 290# Since: 0.13
0e201d34
MA
291#
292# Example:
293#
d23055b8
MA
294# <- { "event": "WATCHDOG",
295# "data": { "action": "reset" },
296# "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
0e201d34
MA
297##
298{ 'event': 'WATCHDOG',
14d53b4f 299 'data': { 'action': 'WatchdogAction' } }
0e201d34
MA
300
301##
14d53b4f 302# @WatchdogAction:
0e201d34 303#
a937b6aa
MA
304# An enumeration of the actions taken when the watchdog device's timer
305# is expired
0e201d34
MA
306#
307# @reset: system resets
308#
a937b6aa
MA
309# @shutdown: system shutdown, note that it is similar to @powerdown,
310# which tries to set to system status and notify guest
0e201d34
MA
311#
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#
a937b6aa
MA
320# @inject-nmi: a non-maskable interrupt is injected into the first
321# VCPU (all VCPUS on x86) (since 2.4)
0e201d34
MA
322#
323# Since: 2.1
324##
14d53b4f 325{ 'enum': 'WatchdogAction',
0e201d34
MA
326 'data': [ 'reset', 'shutdown', 'poweroff', 'pause', 'debug', 'none',
327 'inject-nmi' ] }
328
e6dba048
AJ
329##
330# @RebootAction:
331#
332# Possible QEMU actions upon guest reboot
333#
c27025e0 334# @reset: Reset the VM
e6dba048 335#
a937b6aa
MA
336# @shutdown: Shutdown the VM and exit, according to the shutdown
337# action
e6dba048
AJ
338#
339# Since: 6.0
340##
341{ 'enum': 'RebootAction',
c27025e0 342 'data': [ 'reset', 'shutdown' ] }
e6dba048
AJ
343
344##
345# @ShutdownAction:
346#
347# Possible QEMU actions upon guest shutdown
348#
349# @poweroff: Shutdown the VM and exit
350#
f39057d5 351# @pause: pause the VM
e6dba048
AJ
352#
353# Since: 6.0
354##
355{ 'enum': 'ShutdownAction',
356 'data': [ 'poweroff', 'pause' ] }
357
c753e8e7
AJ
358##
359# @PanicAction:
360#
361# @none: Continue VM execution
362#
363# @pause: Pause the VM
364#
a937b6aa
MA
365# @shutdown: Shutdown the VM and exit, according to the shutdown
366# action
c27025e0 367#
a937b6aa
MA
368# @exit-failure: Shutdown the VM and exit with nonzero status (since
369# 7.1)
0882caf4 370#
c753e8e7
AJ
371# Since: 6.0
372##
373{ 'enum': 'PanicAction',
0882caf4 374 'data': [ 'pause', 'shutdown', 'exit-failure', 'none' ] }
c753e8e7 375
3da7a416
EB
376##
377# @watchdog-set-action:
378#
b2913cc2
PB
379# Set watchdog action.
380#
381# @action: @WatchdogAction action taken when watchdog timer expires.
3da7a416
EB
382#
383# Since: 2.11
b2913cc2
PB
384#
385# Example:
386#
387# -> { "execute": "watchdog-set-action",
388# "arguments": { "action": "inject-nmi" } }
389# <- { "return": {} }
3da7a416
EB
390##
391{ 'command': 'watchdog-set-action', 'data' : {'action': 'WatchdogAction'} }
392
e6dba048
AJ
393##
394# @set-action:
395#
a937b6aa
MA
396# Set the actions that will be taken by the emulator in response to
397# guest events.
e6dba048
AJ
398#
399# @reboot: @RebootAction action taken on guest reboot.
400#
401# @shutdown: @ShutdownAction action taken on guest shutdown.
402#
c753e8e7
AJ
403# @panic: @PanicAction action taken on guest panic.
404#
53d5c36d 405# @watchdog: @WatchdogAction action taken when watchdog timer expires.
e6dba048
AJ
406#
407# Since: 6.0
408#
409# Example:
410#
d23055b8
MA
411# -> { "execute": "set-action",
412# "arguments": { "reboot": "shutdown",
413# "shutdown" : "pause",
414# "panic": "pause",
415# "watchdog": "inject-nmi" } }
416# <- { "return": {} }
e6dba048
AJ
417##
418{ 'command': 'set-action',
419 'data': { '*reboot': 'RebootAction',
420 '*shutdown': 'ShutdownAction',
c753e8e7 421 '*panic': 'PanicAction',
e6dba048
AJ
422 '*watchdog': 'WatchdogAction' },
423 'allow-preconfig': true }
424
0e201d34
MA
425##
426# @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#
436# Example:
437#
d23055b8
MA
438# <- { "event": "GUEST_PANICKED",
439# "data": { "action": "pause" },
440# "timestamp": { "seconds": 1648245231, "microseconds": 900001 } }
0e201d34
MA
441##
442{ 'event': 'GUEST_PANICKED',
443 'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } }
444
7dc58dee
ZP
445##
446# @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#
456# Example:
457#
d23055b8
MA
458# <- { "event": "GUEST_CRASHLOADED",
459# "data": { "action": "run" },
460# "timestamp": { "seconds": 1648245259, "microseconds": 893771 } }
7dc58dee
ZP
461##
462{ 'event': 'GUEST_CRASHLOADED',
463 'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } }
464
0e201d34
MA
465##
466# @GuestPanicAction:
467#
468# An enumeration of the actions taken when guest OS panic is detected
469#
470# @pause: system pauses
471#
86bf13ae
MA
472# @poweroff: system powers off (since 2.8)
473#
474# @run: system continues to run (since 5.0)
475#
476# Since: 2.1
0e201d34
MA
477##
478{ 'enum': 'GuestPanicAction',
7dc58dee 479 'data': [ 'pause', 'poweroff', 'run' ] }
0e201d34
MA
480
481##
482# @GuestPanicInformationType:
483#
484# An enumeration of the guest panic information types
485#
4ada99ad
CB
486# @hyper-v: hyper-v guest panic information type
487#
488# @s390: s390 guest panic information type (Since: 2.12)
489#
0e201d34
MA
490# Since: 2.9
491##
492{ 'enum': 'GuestPanicInformationType',
4ada99ad 493 'data': [ 'hyper-v', 's390' ] }
0e201d34
MA
494
495##
496# @GuestPanicInformation:
497#
498# Information about a guest panic
499#
4ada99ad
CB
500# @type: Crash type that defines the hypervisor specific information
501#
0e201d34
MA
502# Since: 2.9
503##
504{'union': 'GuestPanicInformation',
505 'base': {'type': 'GuestPanicInformationType'},
506 'discriminator': 'type',
a937b6aa
MA
507 'data': {'hyper-v': 'GuestPanicInformationHyperV',
508 's390': 'GuestPanicInformationS390'}}
0e201d34
MA
509
510##
511# @GuestPanicInformationHyperV:
512#
513# Hyper-V specific guest panic information (HV crash MSRs)
514#
b2913cc2
PB
515# @arg1: for Windows, STOP code for the guest crash. For Linux,
516# an error code.
517#
518# @arg2: for Windows, first argument of the STOP. For Linux, the
519# guest OS ID, which has the kernel version in bits 16-47
520# and 0x8100 in bits 48-63.
521#
522# @arg3: for Windows, second argument of the STOP. For Linux, the
523# program counter of the guest.
524#
525# @arg4: for Windows, third argument of the STOP. For Linux, the
526# RAX register (x86) or the stack pointer (aarch64) of the guest.
527#
528# @arg5: for Windows, fourth argument of the STOP. For x86 Linux, the
529# stack pointer of the guest.
530#
0e201d34
MA
531# Since: 2.9
532##
533{'struct': 'GuestPanicInformationHyperV',
a937b6aa
MA
534 'data': {'arg1': 'uint64',
535 'arg2': 'uint64',
536 'arg3': 'uint64',
537 'arg4': 'uint64',
538 'arg5': 'uint64'}}
4ada99ad
CB
539
540##
541# @S390CrashReason:
542#
543# Reason why the CPU is in a crashed state.
544#
545# @unknown: no crash reason was set
546#
547# @disabled-wait: the CPU has entered a disabled wait state
548#
a937b6aa
MA
549# @extint-loop: clock comparator or cpu timer interrupt with new PSW
550# enabled for external interrupts
4ada99ad
CB
551#
552# @pgmint-loop: program interrupt with BAD new PSW
553#
a937b6aa
MA
554# @opint-loop: operation exception interrupt with invalid code at the
555# program interrupt new PSW
4ada99ad
CB
556#
557# Since: 2.12
558##
559{ 'enum': 'S390CrashReason',
560 'data': [ 'unknown',
561 'disabled-wait',
562 'extint-loop',
563 'pgmint-loop',
564 'opint-loop' ] }
565
566##
567# @GuestPanicInformationS390:
568#
569# S390 specific guest panic information (PSW)
570#
571# @core: core id of the CPU that crashed
a937b6aa 572#
4ada99ad 573# @psw-mask: control fields of guest PSW
a937b6aa 574#
4ada99ad 575# @psw-addr: guest instruction address
a937b6aa 576#
4ada99ad
CB
577# @reason: guest crash reason
578#
579# Since: 2.12
580##
581{'struct': 'GuestPanicInformationS390',
a937b6aa
MA
582 'data': {'core': 'uint32',
583 'psw-mask': 'uint64',
584 'psw-addr': 'uint64',
585 'reason': 'S390CrashReason'}}
77b285f7
ZP
586
587##
588# @MEMORY_FAILURE:
589#
590# Emitted when a memory failure occurs on host side.
591#
592# @recipient: recipient is defined as @MemoryFailureRecipient.
593#
1e6b0505 594# @action: action that has been taken.
77b285f7 595#
1e6b0505 596# @flags: flags for MemoryFailureAction.
77b285f7
ZP
597#
598# Since: 5.2
599#
600# Example:
601#
d23055b8
MA
602# <- { "event": "MEMORY_FAILURE",
603# "data": { "recipient": "hypervisor",
604# "action": "fatal",
605# "flags": { "action-required": false,
606# "recursive": false } },
607# "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
77b285f7
ZP
608##
609{ 'event': 'MEMORY_FAILURE',
610 'data': { 'recipient': 'MemoryFailureRecipient',
611 'action': 'MemoryFailureAction',
612 'flags': 'MemoryFailureFlags'} }
613
614##
615# @MemoryFailureRecipient:
616#
617# Hardware memory failure occurs, handled by recipient.
618#
a937b6aa
MA
619# @hypervisor: memory failure at QEMU process address space. (none
620# guest memory, but used by QEMU itself).
77b285f7
ZP
621#
622# @guest: memory failure at guest memory,
623#
624# Since: 5.2
77b285f7
ZP
625##
626{ 'enum': 'MemoryFailureRecipient',
627 'data': [ 'hypervisor',
628 'guest' ] }
629
77b285f7
ZP
630##
631# @MemoryFailureAction:
632#
633# Actions taken by QEMU in response to a hardware memory failure.
634#
a937b6aa
MA
635# @ignore: the memory failure could be ignored. This will only be the
636# case for action-optional failures.
77b285f7 637#
a937b6aa
MA
638# @inject: memory failure occurred in guest memory, the guest enabled
639# MCE handling mechanism, and QEMU could inject the MCE into the
640# guest successfully.
77b285f7 641#
a937b6aa
MA
642# @fatal: the failure is unrecoverable. This occurs for
643# action-required failures if the recipient is the hypervisor;
644# QEMU will exit.
77b285f7 645#
a937b6aa
MA
646# @reset: the failure is unrecoverable but confined to the guest.
647# This occurs if the recipient is a guest guest which is not ready
648# to handle memory failures.
77b285f7
ZP
649#
650# Since: 5.2
77b285f7
ZP
651##
652{ 'enum': 'MemoryFailureAction',
653 'data': [ 'ignore',
654 'inject',
655 'fatal',
656 'reset' ] }
657
658##
659# @MemoryFailureFlags:
660#
661# Additional information on memory failures.
662#
663# @action-required: whether a memory failure event is action-required
a937b6aa 664# or action-optional (e.g. a failure during memory scrub).
77b285f7 665#
a937b6aa
MA
666# @recursive: whether the failure occurred while the previous failure
667# was still in progress.
77b285f7
ZP
668#
669# Since: 5.2
77b285f7
ZP
670##
671{ 'struct': 'MemoryFailureFlags',
672 'data': { 'action-required': 'bool',
673 'recursive': 'bool'} }
e2e69f6b
CQ
674
675##
676# @NotifyVmexitOption:
677#
678# An enumeration of the options specified when enabling notify VM exit
679#
a937b6aa
MA
680# @run: enable the feature, do nothing and continue if the notify VM
681# exit happens.
e2e69f6b 682#
a937b6aa
MA
683# @internal-error: enable the feature, raise a internal error if the
684# notify VM exit happens.
e2e69f6b
CQ
685#
686# @disable: disable the feature.
687#
688# Since: 7.2
689##
690{ 'enum': 'NotifyVmexitOption',
c27f4b66 691 'data': [ 'run', 'internal-error', 'disable' ] }