Merge tag 'v9.0.0-rc3'
[qemu/ar7.git] / qapi / run-state.json
blobf8773f23b298db22bebab16fd48dcf0242fe2f76
1 # -*- Mode: Python -*-
2 # vim: filetype=python
5 ##
6 # = VM run state
7 ##
9 ##
10 # @RunState:
12 # An enumeration of VM run states.
14 # @debug: QEMU is running on a debugger
16 # @finish-migrate: guest is paused to finish the migration process
18 # @inmigrate: guest is paused waiting for an incoming migration.  Note
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.
24 # @internal-error: An internal error that prevents further guest
25 #     execution has occurred
27 # @io-error: the last IOP has failed and the device is configured to
28 #     pause on I/O errors
30 # @paused: guest has been paused via the 'stop' command
32 # @postmigrate: guest is paused following a successful 'migrate'
34 # @prelaunch: QEMU was started with -S and guest has not started
36 # @restore-vm: guest is paused to restore VM state
38 # @running: guest is actively running
40 # @save-vm: guest is paused to save the VM state
42 # @shutdown: guest is shut down (and -no-shutdown is in use)
44 # @suspended: guest is suspended (ACPI S3)
46 # @watchdog: the watchdog action is configured to pause and has been
47 #     triggered
49 # @guest-panicked: guest has been panicked as a result of guest OS
50 #     panic
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)
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',
60             'guest-panicked', 'colo' ] }
63 # @ShutdownCause:
65 # An enumeration of reasons for a Shutdown.
67 # @none: No shutdown request pending
69 # @host-error: An error prevents further use of guest
71 # @host-qmp-quit: Reaction to the QMP command 'quit'
73 # @host-qmp-system-reset: Reaction to the QMP command 'system_reset'
75 # @host-signal: Reaction to a signal, such as SIGINT
77 # @host-ui: Reaction to a UI event, like window close
79 # @guest-shutdown: Guest shutdown/suspend request, via ACPI or other
80 #     hardware-specific means
82 # @guest-reset: Guest reset request, and command line turns that into
83 #     a shutdown
85 # @guest-panic: Guest panicked, and command line turns that into a
86 #     shutdown
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
92 # @snapshot-load: A snapshot is being loaded by the record & replay
93 #     subsystem.  This value is used only within QEMU.  It doesn't
94 #     occur in QMP.  (since 7.2)
96 { 'enum': 'ShutdownCause',
97   # Beware, shutdown_caused_by_guest() depends on enumeration order
98   'data': [ 'none', 'host-error', 'host-qmp-quit', 'host-qmp-system-reset',
99             'host-signal', 'host-ui', 'guest-shutdown', 'guest-reset',
100             'guest-panic', 'subsystem-reset', 'snapshot-load'] }
103 # @StatusInfo:
105 # Information about VM run state
107 # @running: true if all VCPUs are runnable, false if not runnable
109 # @status: the virtual machine @RunState
111 # Since: 0.14
113 { 'struct': 'StatusInfo',
114   'data': {'running': 'bool',
115            'status': 'RunState'} }
118 # @query-status:
120 # Query the run status of the VM
122 # Returns: @StatusInfo reflecting the VM
124 # Since: 0.14
126 # Example:
128 #     -> { "execute": "query-status" }
129 #     <- { "return": { "running": true,
130 #                      "status": "running" } }
132 { 'command': 'query-status', 'returns': 'StatusInfo',
133   'allow-preconfig': true }
136 # @SHUTDOWN:
138 # Emitted when the virtual machine has shut down, indicating that qemu
139 # is about to exit.
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
144 #     sending qemu a SIGINT).  (since 2.10)
146 # @reason: The @ShutdownCause which resulted in the SHUTDOWN.
147 #     (since 4.0)
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
153 # Since: 0.12
155 # Example:
157 #     <- { "event": "SHUTDOWN",
158 #          "data": { "guest": true, "reason": "guest-shutdown" },
159 #          "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
161 { 'event': 'SHUTDOWN', 'data': { 'guest': 'bool', 'reason': 'ShutdownCause' } }
164 # @POWERDOWN:
166 # Emitted when the virtual machine is powered down through the power
167 # control system, such as via ACPI.
169 # Since: 0.12
171 # Example:
173 #     <- { "event": "POWERDOWN",
174 #          "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
176 { 'event': 'POWERDOWN' }
179 # @RESET:
181 # Emitted when the virtual machine is reset
183 # @guest: If true, the reset was triggered by a guest request (such as
184 #     a guest-initiated ACPI reboot request or other hardware-specific
185 #     action) rather than a host request (such as the QMP command
186 #     system_reset).  (since 2.10)
188 # @reason: The @ShutdownCause of the RESET.  (since 4.0)
190 # Since: 0.12
192 # Example:
194 #     <- { "event": "RESET",
195 #          "data": { "guest": false, "reason": "guest-reset" },
196 #          "timestamp": { "seconds": 1267041653, "microseconds": 9518 } }
198 { 'event': 'RESET', 'data': { 'guest': 'bool', 'reason': 'ShutdownCause' } }
201 # @STOP:
203 # Emitted when the virtual machine is stopped
205 # Since: 0.12
207 # Example:
209 #     <- { "event": "STOP",
210 #          "timestamp": { "seconds": 1267041730, "microseconds": 281295 } }
212 { 'event': 'STOP' }
215 # @RESUME:
217 # Emitted when the virtual machine resumes execution
219 # Since: 0.12
221 # Example:
223 #     <- { "event": "RESUME",
224 #          "timestamp": { "seconds": 1271770767, "microseconds": 582542 } }
226 { 'event': 'RESUME' }
229 # @SUSPEND:
231 # Emitted when guest enters a hardware suspension state, for example,
232 # S3 state, which is sometimes called standby state
234 # Since: 1.1
236 # Example:
238 #     <- { "event": "SUSPEND",
239 #          "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
241 { 'event': 'SUSPEND' }
244 # @SUSPEND_DISK:
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
250 # Note: QEMU shuts down (similar to event @SHUTDOWN) when entering
251 #     this state
253 # Since: 1.2
255 # Example:
257 #     <- { "event": "SUSPEND_DISK",
258 #          "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
260 { 'event': 'SUSPEND_DISK' }
263 # @WAKEUP:
265 # Emitted when the guest has woken up from suspend state and is
266 # running
268 # Since: 1.1
270 # Example:
272 #     <- { "event": "WAKEUP",
273 #          "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
275 { 'event': 'WAKEUP' }
278 # @WATCHDOG:
280 # Emitted when the watchdog device's timer is expired
282 # @action: action that has been taken
284 # Note: If action is "reset", "shutdown", or "pause" the WATCHDOG
285 #     event is followed respectively by the RESET, SHUTDOWN, or STOP
286 #     events
288 # Note: This event is rate-limited.
290 # Since: 0.13
292 # Example:
294 #     <- { "event": "WATCHDOG",
295 #          "data": { "action": "reset" },
296 #          "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
298 { 'event': 'WATCHDOG',
299   'data': { 'action': 'WatchdogAction' } }
302 # @WatchdogAction:
304 # An enumeration of the actions taken when the watchdog device's timer
305 # is expired
307 # @reset: system resets
309 # @shutdown: system shutdown, note that it is similar to @powerdown,
310 #     which tries to set to system status and notify guest
312 # @poweroff: system poweroff, the emulator program exits
314 # @pause: system pauses, similar to @stop
316 # @debug: system enters debug state
318 # @none: nothing is done
320 # @inject-nmi: a non-maskable interrupt is injected into the first
321 #     VCPU (all VCPUS on x86) (since 2.4)
323 # Since: 2.1
325 { 'enum': 'WatchdogAction',
326   'data': [ 'reset', 'shutdown', 'poweroff', 'pause', 'debug', 'none',
327             'inject-nmi' ] }
330 # @RebootAction:
332 # Possible QEMU actions upon guest reboot
334 # @reset: Reset the VM
336 # @shutdown: Shutdown the VM and exit, according to the shutdown
337 #     action
339 # Since: 6.0
341 { 'enum': 'RebootAction',
342   'data': [ 'reset', 'shutdown' ] }
345 # @ShutdownAction:
347 # Possible QEMU actions upon guest shutdown
349 # @poweroff: Shutdown the VM and exit
351 # @pause: pause the VM
353 # Since: 6.0
355 { 'enum': 'ShutdownAction',
356   'data': [ 'poweroff', 'pause' ] }
359 # @PanicAction:
361 # @none: Continue VM execution
363 # @pause: Pause the VM
365 # @shutdown: Shutdown the VM and exit, according to the shutdown
366 #     action
368 # @exit-failure: Shutdown the VM and exit with nonzero status (since
369 #     7.1)
371 # Since: 6.0
373 { 'enum': 'PanicAction',
374   'data': [ 'pause', 'shutdown', 'exit-failure', 'none' ] }
377 # @watchdog-set-action:
379 # Set watchdog action.
381 # @action: @WatchdogAction action taken when watchdog timer expires.
383 # Since: 2.11
385 # Example:
387 #     -> { "execute": "watchdog-set-action",
388 #          "arguments": { "action": "inject-nmi" } }
389 #     <- { "return": {} }
391 { 'command': 'watchdog-set-action', 'data' : {'action': 'WatchdogAction'} }
394 # @set-action:
396 # Set the actions that will be taken by the emulator in response to
397 # guest events.
399 # @reboot: @RebootAction action taken on guest reboot.
401 # @shutdown: @ShutdownAction action taken on guest shutdown.
403 # @panic: @PanicAction action taken on guest panic.
405 # @watchdog: @WatchdogAction action taken when watchdog timer expires.
407 # Since: 6.0
409 # Example:
411 #     -> { "execute": "set-action",
412 #          "arguments": { "reboot": "shutdown",
413 #                         "shutdown" : "pause",
414 #                         "panic": "pause",
415 #                         "watchdog": "inject-nmi" } }
416 #     <- { "return": {} }
418 { 'command': 'set-action',
419   'data': { '*reboot': 'RebootAction',
420             '*shutdown': 'ShutdownAction',
421             '*panic': 'PanicAction',
422             '*watchdog': 'WatchdogAction' },
423   'allow-preconfig': true }
426 # @GUEST_PANICKED:
428 # Emitted when guest OS panic is detected
430 # @action: action that has been taken, currently always "pause"
432 # @info: information about a panic (since 2.9)
434 # Since: 1.5
436 # Example:
438 #     <- { "event": "GUEST_PANICKED",
439 #          "data": { "action": "pause" },
440 #          "timestamp": { "seconds": 1648245231, "microseconds": 900001 } }
442 { 'event': 'GUEST_PANICKED',
443   'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } }
446 # @GUEST_CRASHLOADED:
448 # Emitted when guest OS crash loaded is detected
450 # @action: action that has been taken, currently always "run"
452 # @info: information about a panic
454 # Since: 5.0
456 # Example:
458 #     <- { "event": "GUEST_CRASHLOADED",
459 #          "data": { "action": "run" },
460 #          "timestamp": { "seconds": 1648245259, "microseconds": 893771 } }
462 { 'event': 'GUEST_CRASHLOADED',
463   'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } }
466 # @GuestPanicAction:
468 # An enumeration of the actions taken when guest OS panic is detected
470 # @pause: system pauses
472 # @poweroff: system powers off (since 2.8)
474 # @run: system continues to run (since 5.0)
476 # Since: 2.1
478 { 'enum': 'GuestPanicAction',
479   'data': [ 'pause', 'poweroff', 'run' ] }
482 # @GuestPanicInformationType:
484 # An enumeration of the guest panic information types
486 # @hyper-v: hyper-v guest panic information type
488 # @s390: s390 guest panic information type (Since: 2.12)
490 # Since: 2.9
492 { 'enum': 'GuestPanicInformationType',
493   'data': [ 'hyper-v', 's390' ] }
496 # @GuestPanicInformation:
498 # Information about a guest panic
500 # @type: Crash type that defines the hypervisor specific information
502 # Since: 2.9
504 {'union': 'GuestPanicInformation',
505  'base': {'type': 'GuestPanicInformationType'},
506  'discriminator': 'type',
507  'data': {'hyper-v': 'GuestPanicInformationHyperV',
508           's390': 'GuestPanicInformationS390'}}
511 # @GuestPanicInformationHyperV:
513 # Hyper-V specific guest panic information (HV crash MSRs)
515 # @arg1: for Windows, STOP code for the guest crash.  For Linux,
516 #        an error code.
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.
522 # @arg3: for Windows, second argument of the STOP.  For Linux, the
523 #        program counter of the guest.
525 # @arg4: for Windows, third argument of the STOP.  For Linux, the
526 #        RAX register (x86) or the stack pointer (aarch64) of the guest.
528 # @arg5: for Windows, fourth argument of the STOP.  For x86 Linux, the
529 #        stack pointer of the guest.
531 # Since: 2.9
533 {'struct': 'GuestPanicInformationHyperV',
534  'data': {'arg1': 'uint64',
535           'arg2': 'uint64',
536           'arg3': 'uint64',
537           'arg4': 'uint64',
538           'arg5': 'uint64'}}
541 # @S390CrashReason:
543 # Reason why the CPU is in a crashed state.
545 # @unknown: no crash reason was set
547 # @disabled-wait: the CPU has entered a disabled wait state
549 # @extint-loop: clock comparator or cpu timer interrupt with new PSW
550 #     enabled for external interrupts
552 # @pgmint-loop: program interrupt with BAD new PSW
554 # @opint-loop: operation exception interrupt with invalid code at the
555 #     program interrupt new PSW
557 # Since: 2.12
559 { 'enum': 'S390CrashReason',
560   'data': [ 'unknown',
561             'disabled-wait',
562             'extint-loop',
563             'pgmint-loop',
564             'opint-loop' ] }
567 # @GuestPanicInformationS390:
569 # S390 specific guest panic information (PSW)
571 # @core: core id of the CPU that crashed
573 # @psw-mask: control fields of guest PSW
575 # @psw-addr: guest instruction address
577 # @reason: guest crash reason
579 # Since: 2.12
581 {'struct': 'GuestPanicInformationS390',
582  'data': {'core': 'uint32',
583           'psw-mask': 'uint64',
584           'psw-addr': 'uint64',
585           'reason': 'S390CrashReason'}}
588 # @MEMORY_FAILURE:
590 # Emitted when a memory failure occurs on host side.
592 # @recipient: recipient is defined as @MemoryFailureRecipient.
594 # @action: action that has been taken.
596 # @flags: flags for MemoryFailureAction.
598 # Since: 5.2
600 # Example:
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 } }
609 { 'event': 'MEMORY_FAILURE',
610   'data': { 'recipient': 'MemoryFailureRecipient',
611             'action': 'MemoryFailureAction',
612             'flags': 'MemoryFailureFlags'} }
615 # @MemoryFailureRecipient:
617 # Hardware memory failure occurs, handled by recipient.
619 # @hypervisor: memory failure at QEMU process address space.  (none
620 #     guest memory, but used by QEMU itself).
622 # @guest: memory failure at guest memory,
624 # Since: 5.2
626 { 'enum': 'MemoryFailureRecipient',
627   'data': [ 'hypervisor',
628             'guest' ] }
631 # @MemoryFailureAction:
633 # Actions taken by QEMU in response to a hardware memory failure.
635 # @ignore: the memory failure could be ignored.  This will only be the
636 #     case for action-optional failures.
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.
642 # @fatal: the failure is unrecoverable.  This occurs for
643 #     action-required failures if the recipient is the hypervisor;
644 #     QEMU will exit.
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.
650 # Since: 5.2
652 { 'enum': 'MemoryFailureAction',
653   'data': [ 'ignore',
654             'inject',
655             'fatal',
656             'reset' ] }
659 # @MemoryFailureFlags:
661 # Additional information on memory failures.
663 # @action-required: whether a memory failure event is action-required
664 #     or action-optional (e.g. a failure during memory scrub).
666 # @recursive: whether the failure occurred while the previous failure
667 #     was still in progress.
669 # Since: 5.2
671 { 'struct': 'MemoryFailureFlags',
672   'data': { 'action-required': 'bool',
673             'recursive': 'bool'} }
676 # @NotifyVmexitOption:
678 # An enumeration of the options specified when enabling notify VM exit
680 # @run: enable the feature, do nothing and continue if the notify VM
681 #     exit happens.
683 # @internal-error: enable the feature, raise a internal error if the
684 #     notify VM exit happens.
686 # @disable: disable the feature.
688 # Since: 7.2
690 { 'enum': 'NotifyVmexitOption',
691   'data': [ 'run', 'internal-error', 'disable' ] }