qapi: Delete useless "Returns" sections
[qemu/kevin.git] / qapi / run-state.json
blob789fc34559ada5a642fec95ccf37eac9c0addee4
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
114 { 'struct': 'StatusInfo',
115   'data': {'running': 'bool',
116            'status': 'RunState'} }
119 # @query-status:
121 # Query the run status of the VM
123 # Returns: @StatusInfo reflecting the VM
125 # Since: 0.14
127 # Example:
129 #     -> { "execute": "query-status" }
130 #     <- { "return": { "running": true,
131 #                      "status": "running" } }
133 { 'command': 'query-status', 'returns': 'StatusInfo',
134   'allow-preconfig': true }
137 # @SHUTDOWN:
139 # Emitted when the virtual machine has shut down, indicating that qemu
140 # is about to exit.
142 # @guest: If true, the shutdown was triggered by a guest request (such
143 #     as a guest-initiated ACPI shutdown request or other
144 #     hardware-specific action) rather than a host request (such as
145 #     sending qemu a SIGINT). (since 2.10)
147 # @reason: The @ShutdownCause which resulted in the SHUTDOWN. (since
148 #     4.0)
150 # Note: If the command-line option "-no-shutdown" has been specified,
151 #     qemu will not exit, and a STOP event will eventually follow the
152 #     SHUTDOWN event
154 # Since: 0.12
156 # Example:
158 #     <- { "event": "SHUTDOWN",
159 #          "data": { "guest": true, "reason": "guest-shutdown" },
160 #          "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
162 { 'event': 'SHUTDOWN', 'data': { 'guest': 'bool', 'reason': 'ShutdownCause' } }
165 # @POWERDOWN:
167 # Emitted when the virtual machine is powered down through the power
168 # control system, such as via ACPI.
170 # Since: 0.12
172 # Example:
174 #     <- { "event": "POWERDOWN",
175 #          "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
177 { 'event': 'POWERDOWN' }
180 # @RESET:
182 # Emitted when the virtual machine is reset
184 # @guest: If true, the reset was triggered by a guest request (such as
185 #     a guest-initiated ACPI reboot request or other hardware-specific
186 #     action) rather than a host request (such as the QMP command
187 #     system_reset). (since 2.10)
189 # @reason: The @ShutdownCause of the RESET. (since 4.0)
191 # Since: 0.12
193 # Example:
195 #     <- { "event": "RESET",
196 #          "data": { "guest": false, "reason": "guest-reset" },
197 #          "timestamp": { "seconds": 1267041653, "microseconds": 9518 } }
199 { 'event': 'RESET', 'data': { 'guest': 'bool', 'reason': 'ShutdownCause' } }
202 # @STOP:
204 # Emitted when the virtual machine is stopped
206 # Since: 0.12
208 # Example:
210 #     <- { "event": "STOP",
211 #          "timestamp": { "seconds": 1267041730, "microseconds": 281295 } }
213 { 'event': 'STOP' }
216 # @RESUME:
218 # Emitted when the virtual machine resumes execution
220 # Since: 0.12
222 # Example:
224 #     <- { "event": "RESUME",
225 #          "timestamp": { "seconds": 1271770767, "microseconds": 582542 } }
227 { 'event': 'RESUME' }
230 # @SUSPEND:
232 # Emitted when guest enters a hardware suspension state, for example,
233 # S3 state, which is sometimes called standby state
235 # Since: 1.1
237 # Example:
239 #     <- { "event": "SUSPEND",
240 #          "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
242 { 'event': 'SUSPEND' }
245 # @SUSPEND_DISK:
247 # Emitted when guest enters a hardware suspension state with data
248 # saved on disk, for example, S4 state, which is sometimes called
249 # hibernate state
251 # Note: QEMU shuts down (similar to event @SHUTDOWN) when entering
252 #     this state
254 # Since: 1.2
256 # Example:
258 #     <- { "event": "SUSPEND_DISK",
259 #          "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
261 { 'event': 'SUSPEND_DISK' }
264 # @WAKEUP:
266 # Emitted when the guest has woken up from suspend state and is
267 # running
269 # Since: 1.1
271 # Example:
273 #     <- { "event": "WAKEUP",
274 #          "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
276 { 'event': 'WAKEUP' }
279 # @WATCHDOG:
281 # Emitted when the watchdog device's timer is expired
283 # @action: action that has been taken
285 # Note: If action is "reset", "shutdown", or "pause" the WATCHDOG
286 #     event is followed respectively by the RESET, SHUTDOWN, or STOP
287 #     events
289 # Note: This event is rate-limited.
291 # Since: 0.13
293 # Example:
295 #     <- { "event": "WATCHDOG",
296 #          "data": { "action": "reset" },
297 #          "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
299 { 'event': 'WATCHDOG',
300   'data': { 'action': 'WatchdogAction' } }
303 # @WatchdogAction:
305 # An enumeration of the actions taken when the watchdog device's timer
306 # is expired
308 # @reset: system resets
310 # @shutdown: system shutdown, note that it is similar to @powerdown,
311 #     which tries to set to system status and notify guest
313 # @poweroff: system poweroff, the emulator program exits
315 # @pause: system pauses, similar to @stop
317 # @debug: system enters debug state
319 # @none: nothing is done
321 # @inject-nmi: a non-maskable interrupt is injected into the first
322 #     VCPU (all VCPUS on x86) (since 2.4)
324 # Since: 2.1
326 { 'enum': 'WatchdogAction',
327   'data': [ 'reset', 'shutdown', 'poweroff', 'pause', 'debug', 'none',
328             'inject-nmi' ] }
331 # @RebootAction:
333 # Possible QEMU actions upon guest reboot
335 # @reset: Reset the VM
337 # @shutdown: Shutdown the VM and exit, according to the shutdown
338 #     action
340 # Since: 6.0
342 { 'enum': 'RebootAction',
343   'data': [ 'reset', 'shutdown' ] }
346 # @ShutdownAction:
348 # Possible QEMU actions upon guest shutdown
350 # @poweroff: Shutdown the VM and exit
352 # @pause: pause the VM
354 # Since: 6.0
356 { 'enum': 'ShutdownAction',
357   'data': [ 'poweroff', 'pause' ] }
360 # @PanicAction:
362 # @none: Continue VM execution
364 # @pause: Pause the VM
366 # @shutdown: Shutdown the VM and exit, according to the shutdown
367 #     action
369 # @exit-failure: Shutdown the VM and exit with nonzero status (since
370 #     7.1)
372 # Since: 6.0
374 { 'enum': 'PanicAction',
375   'data': [ 'pause', 'shutdown', 'exit-failure', 'none' ] }
378 # @watchdog-set-action:
380 # Set watchdog action
382 # Since: 2.11
384 { 'command': 'watchdog-set-action', 'data' : {'action': 'WatchdogAction'} }
387 # @set-action:
389 # Set the actions that will be taken by the emulator in response to
390 # guest events.
392 # @reboot: @RebootAction action taken on guest reboot.
394 # @shutdown: @ShutdownAction action taken on guest shutdown.
396 # @panic: @PanicAction action taken on guest panic.
398 # @watchdog: @WatchdogAction action taken when watchdog timer expires.
400 # Since: 6.0
402 # Example:
404 #     -> { "execute": "set-action",
405 #          "arguments": { "reboot": "shutdown",
406 #                         "shutdown" : "pause",
407 #                         "panic": "pause",
408 #                         "watchdog": "inject-nmi" } }
409 #     <- { "return": {} }
411 { 'command': 'set-action',
412   'data': { '*reboot': 'RebootAction',
413             '*shutdown': 'ShutdownAction',
414             '*panic': 'PanicAction',
415             '*watchdog': 'WatchdogAction' },
416   'allow-preconfig': true }
419 # @GUEST_PANICKED:
421 # Emitted when guest OS panic is detected
423 # @action: action that has been taken, currently always "pause"
425 # @info: information about a panic (since 2.9)
427 # Since: 1.5
429 # Example:
431 #     <- { "event": "GUEST_PANICKED",
432 #          "data": { "action": "pause" },
433 #          "timestamp": { "seconds": 1648245231, "microseconds": 900001 } }
435 { 'event': 'GUEST_PANICKED',
436   'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } }
439 # @GUEST_CRASHLOADED:
441 # Emitted when guest OS crash loaded is detected
443 # @action: action that has been taken, currently always "run"
445 # @info: information about a panic
447 # Since: 5.0
449 # Example:
451 #     <- { "event": "GUEST_CRASHLOADED",
452 #          "data": { "action": "run" },
453 #          "timestamp": { "seconds": 1648245259, "microseconds": 893771 } }
455 { 'event': 'GUEST_CRASHLOADED',
456   'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } }
459 # @GuestPanicAction:
461 # An enumeration of the actions taken when guest OS panic is detected
463 # @pause: system pauses
465 # @poweroff: system powers off (since 2.8)
467 # @run: system continues to run (since 5.0)
469 # Since: 2.1
471 { 'enum': 'GuestPanicAction',
472   'data': [ 'pause', 'poweroff', 'run' ] }
475 # @GuestPanicInformationType:
477 # An enumeration of the guest panic information types
479 # @hyper-v: hyper-v guest panic information type
481 # @s390: s390 guest panic information type (Since: 2.12)
483 # Since: 2.9
485 { 'enum': 'GuestPanicInformationType',
486   'data': [ 'hyper-v', 's390' ] }
489 # @GuestPanicInformation:
491 # Information about a guest panic
493 # @type: Crash type that defines the hypervisor specific information
495 # Since: 2.9
497 {'union': 'GuestPanicInformation',
498  'base': {'type': 'GuestPanicInformationType'},
499  'discriminator': 'type',
500  'data': {'hyper-v': 'GuestPanicInformationHyperV',
501           's390': 'GuestPanicInformationS390'}}
504 # @GuestPanicInformationHyperV:
506 # Hyper-V specific guest panic information (HV crash MSRs)
508 # Since: 2.9
510 {'struct': 'GuestPanicInformationHyperV',
511  'data': {'arg1': 'uint64',
512           'arg2': 'uint64',
513           'arg3': 'uint64',
514           'arg4': 'uint64',
515           'arg5': 'uint64'}}
518 # @S390CrashReason:
520 # Reason why the CPU is in a crashed state.
522 # @unknown: no crash reason was set
524 # @disabled-wait: the CPU has entered a disabled wait state
526 # @extint-loop: clock comparator or cpu timer interrupt with new PSW
527 #     enabled for external interrupts
529 # @pgmint-loop: program interrupt with BAD new PSW
531 # @opint-loop: operation exception interrupt with invalid code at the
532 #     program interrupt new PSW
534 # Since: 2.12
536 { 'enum': 'S390CrashReason',
537   'data': [ 'unknown',
538             'disabled-wait',
539             'extint-loop',
540             'pgmint-loop',
541             'opint-loop' ] }
544 # @GuestPanicInformationS390:
546 # S390 specific guest panic information (PSW)
548 # @core: core id of the CPU that crashed
550 # @psw-mask: control fields of guest PSW
552 # @psw-addr: guest instruction address
554 # @reason: guest crash reason
556 # Since: 2.12
558 {'struct': 'GuestPanicInformationS390',
559  'data': {'core': 'uint32',
560           'psw-mask': 'uint64',
561           'psw-addr': 'uint64',
562           'reason': 'S390CrashReason'}}
565 # @MEMORY_FAILURE:
567 # Emitted when a memory failure occurs on host side.
569 # @recipient: recipient is defined as @MemoryFailureRecipient.
571 # @action: action that has been taken.  action is defined as
572 #     @MemoryFailureAction.
574 # @flags: flags for MemoryFailureAction.  action is defined as
575 #     @MemoryFailureFlags.
577 # Since: 5.2
579 # Example:
581 #     <- { "event": "MEMORY_FAILURE",
582 #          "data": { "recipient": "hypervisor",
583 #                    "action": "fatal",
584 #                    "flags": { "action-required": false,
585 #                               "recursive": false } },
586 #          "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
588 { 'event': 'MEMORY_FAILURE',
589   'data': { 'recipient': 'MemoryFailureRecipient',
590             'action': 'MemoryFailureAction',
591             'flags': 'MemoryFailureFlags'} }
594 # @MemoryFailureRecipient:
596 # Hardware memory failure occurs, handled by recipient.
598 # @hypervisor: memory failure at QEMU process address space.  (none
599 #     guest memory, but used by QEMU itself).
601 # @guest: memory failure at guest memory,
603 # Since: 5.2
605 { 'enum': 'MemoryFailureRecipient',
606   'data': [ 'hypervisor',
607             'guest' ] }
610 # @MemoryFailureAction:
612 # Actions taken by QEMU in response to a hardware memory failure.
614 # @ignore: the memory failure could be ignored.  This will only be the
615 #     case for action-optional failures.
617 # @inject: memory failure occurred in guest memory, the guest enabled
618 #     MCE handling mechanism, and QEMU could inject the MCE into the
619 #     guest successfully.
621 # @fatal: the failure is unrecoverable.  This occurs for
622 #     action-required failures if the recipient is the hypervisor;
623 #     QEMU will exit.
625 # @reset: the failure is unrecoverable but confined to the guest.
626 #     This occurs if the recipient is a guest guest which is not ready
627 #     to handle memory failures.
629 # Since: 5.2
631 { 'enum': 'MemoryFailureAction',
632   'data': [ 'ignore',
633             'inject',
634             'fatal',
635             'reset' ] }
638 # @MemoryFailureFlags:
640 # Additional information on memory failures.
642 # @action-required: whether a memory failure event is action-required
643 #     or action-optional (e.g. a failure during memory scrub).
645 # @recursive: whether the failure occurred while the previous failure
646 #     was still in progress.
648 # Since: 5.2
650 { 'struct': 'MemoryFailureFlags',
651   'data': { 'action-required': 'bool',
652             'recursive': 'bool'} }
655 # @NotifyVmexitOption:
657 # An enumeration of the options specified when enabling notify VM exit
659 # @run: enable the feature, do nothing and continue if the notify VM
660 #     exit happens.
662 # @internal-error: enable the feature, raise a internal error if the
663 #     notify VM exit happens.
665 # @disable: disable the feature.
667 # Since: 7.2
669 { 'enum': 'NotifyVmexitOption',
670   'data': [ 'run', 'internal-error', 'disable' ] }