Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20210330' into...
[qemu/ar7.git] / qapi / run-state.json
blob43d66d700fcd202e50b33c9743eee8e9f9f7a98b
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 the
20 #             end of the migration.  This depends on the command-line -S option and
21 #             any invocation of 'stop' or 'cont' that has happened since QEMU was
22 #             started.
24 # @internal-error: An internal error that prevents further guest execution
25 #                  has occurred
27 # @io-error: the last IOP has failed and the device is configured to pause
28 #            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 triggered
48 # @guest-panicked: guest has been panicked as a result of guest OS panic
50 # @colo: guest is paused to save/restore VM state under colo checkpoint,
51 #        VM can not get into this state unless colo capability is enabled
52 #        for migration. (since 2.8)
54 { 'enum': 'RunState',
55   'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused',
56             'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm',
57             'running', 'save-vm', 'shutdown', 'suspended', 'watchdog',
58             'guest-panicked', 'colo' ] }
61 # @ShutdownCause:
63 # An enumeration of reasons for a Shutdown.
65 # @none: No shutdown request pending
67 # @host-error: An error prevents further use of guest
69 # @host-qmp-quit: Reaction to the QMP command 'quit'
71 # @host-qmp-system-reset: Reaction to the QMP command 'system_reset'
73 # @host-signal: Reaction to a signal, such as SIGINT
75 # @host-ui: Reaction to a UI event, like window close
77 # @guest-shutdown: Guest shutdown/suspend request, via ACPI or other
78 #                  hardware-specific means
80 # @guest-reset: Guest reset request, and command line turns that into
81 #               a shutdown
83 # @guest-panic: Guest panicked, and command line turns that into a shutdown
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
90 { 'enum': 'ShutdownCause',
91   # Beware, shutdown_caused_by_guest() depends on enumeration order
92   'data': [ 'none', 'host-error', 'host-qmp-quit', 'host-qmp-system-reset',
93             'host-signal', 'host-ui', 'guest-shutdown', 'guest-reset',
94             'guest-panic', 'subsystem-reset'] }
97 # @StatusInfo:
99 # Information about VCPU run state
101 # @running: true if all VCPUs are runnable, false if not runnable
103 # @singlestep: true if VCPUs are in single-step mode
105 # @status: the virtual machine @RunState
107 # Since:  0.14
109 # Notes: @singlestep is enabled through the GDB stub
111 { 'struct': 'StatusInfo',
112   'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
115 # @query-status:
117 # Query the run status of all VCPUs
119 # Returns: @StatusInfo reflecting all VCPUs
121 # Since:  0.14
123 # Example:
125 # -> { "execute": "query-status" }
126 # <- { "return": { "running": true,
127 #                  "singlestep": false,
128 #                  "status": "running" } }
131 { 'command': 'query-status', 'returns': 'StatusInfo',
132   'allow-preconfig': true }
135 # @SHUTDOWN:
137 # Emitted when the virtual machine has shut down, indicating that qemu is
138 # about to exit.
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)
144 # @reason: The @ShutdownCause which resulted in the SHUTDOWN. (since 4.0)
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
149 # Since: 0.12
151 # Example:
153 # <- { "event": "SHUTDOWN", "data": { "guest": true },
154 #      "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
157 { 'event': 'SHUTDOWN', 'data': { 'guest': 'bool', 'reason': 'ShutdownCause' } }
160 # @POWERDOWN:
162 # Emitted when the virtual machine is powered down through the power control
163 # system, such as via ACPI.
165 # Since: 0.12
167 # Example:
169 # <- { "event": "POWERDOWN",
170 #      "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
173 { 'event': 'POWERDOWN' }
176 # @RESET:
178 # Emitted when the virtual machine is reset
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)
185 # @reason: The @ShutdownCause of the RESET. (since 4.0)
187 # Since: 0.12
189 # Example:
191 # <- { "event": "RESET", "data": { "guest": false },
192 #      "timestamp": { "seconds": 1267041653, "microseconds": 9518 } }
195 { 'event': 'RESET', 'data': { 'guest': 'bool', 'reason': 'ShutdownCause' } }
198 # @STOP:
200 # Emitted when the virtual machine is stopped
202 # Since: 0.12
204 # Example:
206 # <- { "event": "STOP",
207 #      "timestamp": { "seconds": 1267041730, "microseconds": 281295 } }
210 { 'event': 'STOP' }
213 # @RESUME:
215 # Emitted when the virtual machine resumes execution
217 # Since: 0.12
219 # Example:
221 # <- { "event": "RESUME",
222 #      "timestamp": { "seconds": 1271770767, "microseconds": 582542 } }
225 { 'event': 'RESUME' }
228 # @SUSPEND:
230 # Emitted when guest enters a hardware suspension state, for example, S3 state,
231 # which is sometimes called standby state
233 # Since: 1.1
235 # Example:
237 # <- { "event": "SUSPEND",
238 #      "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
241 { 'event': 'SUSPEND' }
244 # @SUSPEND_DISK:
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
249 # Note: QEMU shuts down (similar to event @SHUTDOWN) when entering this state
251 # Since: 1.2
253 # Example:
255 # <-   { "event": "SUSPEND_DISK",
256 #        "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
259 { 'event': 'SUSPEND_DISK' }
262 # @WAKEUP:
264 # Emitted when the guest has woken up from suspend state and is running
266 # Since: 1.1
268 # Example:
270 # <- { "event": "WAKEUP",
271 #      "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
274 { 'event': 'WAKEUP' }
277 # @WATCHDOG:
279 # Emitted when the watchdog device's timer is expired
281 # @action: action that has been taken
283 # Note: If action is "reset", "shutdown", or "pause" the WATCHDOG event is
284 #       followed respectively by the RESET, SHUTDOWN, or STOP events
286 # Note: This event is rate-limited.
288 # Since: 0.13
290 # Example:
292 # <- { "event": "WATCHDOG",
293 #      "data": { "action": "reset" },
294 #      "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
297 { 'event': 'WATCHDOG',
298   'data': { 'action': 'WatchdogAction' } }
301 # @WatchdogAction:
303 # An enumeration of the actions taken when the watchdog device's timer is
304 # expired
306 # @reset: system resets
308 # @shutdown: system shutdown, note that it is similar to @powerdown, which
309 #            tries to set to system status and notify guest
311 # @poweroff: system poweroff, the emulator program exits
313 # @pause: system pauses, similar to @stop
315 # @debug: system enters debug state
317 # @none: nothing is done
319 # @inject-nmi: a non-maskable interrupt is injected into the first VCPU (all
320 #              VCPUS on x86) (since 2.4)
322 # Since: 2.1
324 { 'enum': 'WatchdogAction',
325   'data': [ 'reset', 'shutdown', 'poweroff', 'pause', 'debug', 'none',
326             'inject-nmi' ] }
329 # @RebootAction:
331 # Possible QEMU actions upon guest reboot
333 # @reset: Reset the VM
335 # @shutdown: Shutdown the VM and exit, according to the shutdown action
337 # Since: 6.0
339 { 'enum': 'RebootAction',
340   'data': [ 'reset', 'shutdown' ] }
343 # @ShutdownAction:
345 # Possible QEMU actions upon guest shutdown
347 # @poweroff: Shutdown the VM and exit
349 # @pause: pause the VM#
351 # Since: 6.0
353 { 'enum': 'ShutdownAction',
354   'data': [ 'poweroff', 'pause' ] }
357 # @PanicAction:
359 # @none: Continue VM execution
361 # @pause: Pause the VM
363 # @shutdown: Shutdown the VM and exit, according to the shutdown action
365 # Since: 6.0
367 { 'enum': 'PanicAction',
368   'data': [ 'pause', 'shutdown', 'none' ] }
371 # @watchdog-set-action:
373 # Set watchdog action
375 # Since: 2.11
377 { 'command': 'watchdog-set-action', 'data' : {'action': 'WatchdogAction'} }
380 # @set-action:
382 # Set the actions that will be taken by the emulator in response to guest
383 # events.
385 # @reboot: @RebootAction action taken on guest reboot.
387 # @shutdown: @ShutdownAction action taken on guest shutdown.
389 # @panic: @PanicAction action taken on guest panic.
391 # @watchdog: @WatchdogAction action taken when watchdog timer expires .
393 # Returns: Nothing on success.
395 # Since: 6.0
397 # Example:
399 # -> { "execute": "set-action",
400 #      "arguments": { "reboot": "shutdown",
401 #                     "shutdown" : "pause",
402 #                     "panic": "pause",
403 #                     "watchdog": "inject-nmi" } }
404 # <- { "return": {} }
406 { 'command': 'set-action',
407   'data': { '*reboot': 'RebootAction',
408             '*shutdown': 'ShutdownAction',
409             '*panic': 'PanicAction',
410             '*watchdog': 'WatchdogAction' },
411   'allow-preconfig': true }
414 # @GUEST_PANICKED:
416 # Emitted when guest OS panic is detected
418 # @action: action that has been taken, currently always "pause"
420 # @info: information about a panic (since 2.9)
422 # Since: 1.5
424 # Example:
426 # <- { "event": "GUEST_PANICKED",
427 #      "data": { "action": "pause" } }
430 { 'event': 'GUEST_PANICKED',
431   'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } }
434 # @GUEST_CRASHLOADED:
436 # Emitted when guest OS crash loaded is detected
438 # @action: action that has been taken, currently always "run"
440 # @info: information about a panic
442 # Since: 5.0
444 # Example:
446 # <- { "event": "GUEST_CRASHLOADED",
447 #      "data": { "action": "run" } }
450 { 'event': 'GUEST_CRASHLOADED',
451   'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } }
454 # @GuestPanicAction:
456 # An enumeration of the actions taken when guest OS panic is detected
458 # @pause: system pauses
460 # Since: 2.1 (poweroff since 2.8, run since 5.0)
462 { 'enum': 'GuestPanicAction',
463   'data': [ 'pause', 'poweroff', 'run' ] }
466 # @GuestPanicInformationType:
468 # An enumeration of the guest panic information types
470 # @hyper-v: hyper-v guest panic information type
472 # @s390: s390 guest panic information type (Since: 2.12)
474 # Since: 2.9
476 { 'enum': 'GuestPanicInformationType',
477   'data': [ 'hyper-v', 's390' ] }
480 # @GuestPanicInformation:
482 # Information about a guest panic
484 # @type: Crash type that defines the hypervisor specific information
486 # Since: 2.9
488 {'union': 'GuestPanicInformation',
489  'base': {'type': 'GuestPanicInformationType'},
490  'discriminator': 'type',
491  'data': { 'hyper-v': 'GuestPanicInformationHyperV',
492            's390': 'GuestPanicInformationS390' } }
495 # @GuestPanicInformationHyperV:
497 # Hyper-V specific guest panic information (HV crash MSRs)
499 # Since: 2.9
501 {'struct': 'GuestPanicInformationHyperV',
502  'data': { 'arg1': 'uint64',
503            'arg2': 'uint64',
504            'arg3': 'uint64',
505            'arg4': 'uint64',
506            'arg5': 'uint64' } }
509 # @S390CrashReason:
511 # Reason why the CPU is in a crashed state.
513 # @unknown: no crash reason was set
515 # @disabled-wait: the CPU has entered a disabled wait state
517 # @extint-loop: clock comparator or cpu timer interrupt with new PSW enabled
518 #               for external interrupts
520 # @pgmint-loop: program interrupt with BAD new PSW
522 # @opint-loop: operation exception interrupt with invalid code at the program
523 #              interrupt new PSW
525 # Since: 2.12
527 { 'enum': 'S390CrashReason',
528   'data': [ 'unknown',
529             'disabled-wait',
530             'extint-loop',
531             'pgmint-loop',
532             'opint-loop' ] }
535 # @GuestPanicInformationS390:
537 # S390 specific guest panic information (PSW)
539 # @core: core id of the CPU that crashed
540 # @psw-mask: control fields of guest PSW
541 # @psw-addr: guest instruction address
542 # @reason: guest crash reason
544 # Since: 2.12
546 {'struct': 'GuestPanicInformationS390',
547  'data': { 'core': 'uint32',
548            'psw-mask': 'uint64',
549            'psw-addr': 'uint64',
550            'reason': 'S390CrashReason' } }
553 # @MEMORY_FAILURE:
555 # Emitted when a memory failure occurs on host side.
557 # @recipient: recipient is defined as @MemoryFailureRecipient.
559 # @action: action that has been taken. action is defined as @MemoryFailureAction.
561 # @flags: flags for MemoryFailureAction. action is defined as @MemoryFailureFlags.
563 # Since: 5.2
565 # Example:
567 # <- { "event": "MEMORY_FAILURE",
568 #      "data": { "recipient": "hypervisor",
569 #                "action": "fatal",
570 #                "flags": { 'action-required': false } }
573 { 'event': 'MEMORY_FAILURE',
574   'data': { 'recipient': 'MemoryFailureRecipient',
575             'action': 'MemoryFailureAction',
576             'flags': 'MemoryFailureFlags'} }
579 # @MemoryFailureRecipient:
581 # Hardware memory failure occurs, handled by recipient.
583 # @hypervisor: memory failure at QEMU process address space.
584 #              (none guest memory, but used by QEMU itself).
586 # @guest: memory failure at guest memory,
588 # Since: 5.2
591 { 'enum': 'MemoryFailureRecipient',
592   'data': [ 'hypervisor',
593             'guest' ] }
597 # @MemoryFailureAction:
599 # Actions taken by QEMU in response to a hardware memory failure.
601 # @ignore: the memory failure could be ignored.  This will only be the case
602 #          for action-optional failures.
604 # @inject: memory failure occurred in guest memory, the guest enabled MCE
605 #          handling mechanism, and QEMU could inject the MCE into the guest
606 #          successfully.
608 # @fatal: the failure is unrecoverable.  This occurs for action-required
609 #         failures if the recipient is the hypervisor; QEMU will exit.
611 # @reset: the failure is unrecoverable but confined to the guest.  This
612 #         occurs if the recipient is a guest guest which is not ready
613 #         to handle memory failures.
615 # Since: 5.2
618 { 'enum': 'MemoryFailureAction',
619   'data': [ 'ignore',
620             'inject',
621             'fatal',
622             'reset' ] }
625 # @MemoryFailureFlags:
627 # Additional information on memory failures.
629 # @action-required: whether a memory failure event is action-required
630 #                   or action-optional (e.g. a failure during memory scrub).
632 # @recursive: whether the failure occurred while the previous
633 #             failure was still in progress.
635 # Since: 5.2
638 { 'struct': 'MemoryFailureFlags',
639   'data': { 'action-required': 'bool',
640             'recursive': 'bool'} }