test/avocado/machine_aspeed.py: Add I2C tests to ast2500-evb
[qemu.git] / qapi / run-state.json
blob6e2162d7b38e5473d1e82c14cc7a8db7bcc57f0a
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",
154 #      "data": { "guest": true, "reason": "guest-shutdown" },
155 #      "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
158 { 'event': 'SHUTDOWN', 'data': { 'guest': 'bool', 'reason': 'ShutdownCause' } }
161 # @POWERDOWN:
163 # Emitted when the virtual machine is powered down through the power control
164 # system, such as via ACPI.
166 # Since: 0.12
168 # Example:
170 # <- { "event": "POWERDOWN",
171 #      "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
174 { 'event': 'POWERDOWN' }
177 # @RESET:
179 # Emitted when the virtual machine is reset
181 # @guest: If true, the reset was triggered by a guest request (such as
182 #         a guest-initiated ACPI reboot request or other hardware-specific action)
183 #         rather than a host request (such as the QMP command system_reset).
184 #         (since 2.10)
186 # @reason: The @ShutdownCause of the RESET. (since 4.0)
188 # Since: 0.12
190 # Example:
192 # <- { "event": "RESET",
193 #      "data": { "guest": false, "reason": "guest-reset" },
194 #      "timestamp": { "seconds": 1267041653, "microseconds": 9518 } }
197 { 'event': 'RESET', 'data': { 'guest': 'bool', 'reason': 'ShutdownCause' } }
200 # @STOP:
202 # Emitted when the virtual machine is stopped
204 # Since: 0.12
206 # Example:
208 # <- { "event": "STOP",
209 #      "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 } }
227 { 'event': 'RESUME' }
230 # @SUSPEND:
232 # Emitted when guest enters a hardware suspension state, for example, S3 state,
233 # which is sometimes called standby state
235 # Since: 1.1
237 # Example:
239 # <- { "event": "SUSPEND",
240 #      "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
243 { 'event': 'SUSPEND' }
246 # @SUSPEND_DISK:
248 # Emitted when guest enters a hardware suspension state with data saved on
249 # disk, for example, S4 state, which is sometimes called hibernate state
251 # Note: QEMU shuts down (similar to event @SHUTDOWN) when entering this state
253 # Since: 1.2
255 # Example:
257 # <-   { "event": "SUSPEND_DISK",
258 #        "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
261 { 'event': 'SUSPEND_DISK' }
264 # @WAKEUP:
266 # Emitted when the guest has woken up from suspend state and is running
268 # Since: 1.1
270 # Example:
272 # <- { "event": "WAKEUP",
273 #      "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 event is
286 #       followed respectively by the RESET, SHUTDOWN, or STOP 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 } }
299 { 'event': 'WATCHDOG',
300   'data': { 'action': 'WatchdogAction' } }
303 # @WatchdogAction:
305 # An enumeration of the actions taken when the watchdog device's timer is
306 # expired
308 # @reset: system resets
310 # @shutdown: system shutdown, note that it is similar to @powerdown, which
311 #            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 VCPU (all
322 #              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 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 action
367 # Since: 6.0
369 { 'enum': 'PanicAction',
370   'data': [ 'pause', 'shutdown', 'none' ] }
373 # @watchdog-set-action:
375 # Set watchdog action
377 # Since: 2.11
379 { 'command': 'watchdog-set-action', 'data' : {'action': 'WatchdogAction'} }
382 # @set-action:
384 # Set the actions that will be taken by the emulator in response to guest
385 # events.
387 # @reboot: @RebootAction action taken on guest reboot.
389 # @shutdown: @ShutdownAction action taken on guest shutdown.
391 # @panic: @PanicAction action taken on guest panic.
393 # @watchdog: @WatchdogAction action taken when watchdog timer expires .
395 # Returns: Nothing on success.
397 # Since: 6.0
399 # Example:
401 # -> { "execute": "set-action",
402 #      "arguments": { "reboot": "shutdown",
403 #                     "shutdown" : "pause",
404 #                     "panic": "pause",
405 #                     "watchdog": "inject-nmi" } }
406 # <- { "return": {} }
408 { 'command': 'set-action',
409   'data': { '*reboot': 'RebootAction',
410             '*shutdown': 'ShutdownAction',
411             '*panic': 'PanicAction',
412             '*watchdog': 'WatchdogAction' },
413   'allow-preconfig': true }
416 # @GUEST_PANICKED:
418 # Emitted when guest OS panic is detected
420 # @action: action that has been taken, currently always "pause"
422 # @info: information about a panic (since 2.9)
424 # Since: 1.5
426 # Example:
428 # <- { "event": "GUEST_PANICKED",
429 #      "data": { "action": "pause" },
430 #      "timestamp": { "seconds": 1648245231, "microseconds": 900001 } }
433 { 'event': 'GUEST_PANICKED',
434   'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } }
437 # @GUEST_CRASHLOADED:
439 # Emitted when guest OS crash loaded is detected
441 # @action: action that has been taken, currently always "run"
443 # @info: information about a panic
445 # Since: 5.0
447 # Example:
449 # <- { "event": "GUEST_CRASHLOADED",
450 #      "data": { "action": "run" },
451 #      "timestamp": { "seconds": 1648245259, "microseconds": 893771 } }
454 { 'event': 'GUEST_CRASHLOADED',
455   'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } }
458 # @GuestPanicAction:
460 # An enumeration of the actions taken when guest OS panic is detected
462 # @pause: system pauses
464 # Since: 2.1 (poweroff since 2.8, run since 5.0)
466 { 'enum': 'GuestPanicAction',
467   'data': [ 'pause', 'poweroff', 'run' ] }
470 # @GuestPanicInformationType:
472 # An enumeration of the guest panic information types
474 # @hyper-v: hyper-v guest panic information type
476 # @s390: s390 guest panic information type (Since: 2.12)
478 # Since: 2.9
480 { 'enum': 'GuestPanicInformationType',
481   'data': [ 'hyper-v', 's390' ] }
484 # @GuestPanicInformation:
486 # Information about a guest panic
488 # @type: Crash type that defines the hypervisor specific information
490 # Since: 2.9
492 {'union': 'GuestPanicInformation',
493  'base': {'type': 'GuestPanicInformationType'},
494  'discriminator': 'type',
495  'data': { 'hyper-v': 'GuestPanicInformationHyperV',
496            's390': 'GuestPanicInformationS390' } }
499 # @GuestPanicInformationHyperV:
501 # Hyper-V specific guest panic information (HV crash MSRs)
503 # Since: 2.9
505 {'struct': 'GuestPanicInformationHyperV',
506  'data': { 'arg1': 'uint64',
507            'arg2': 'uint64',
508            'arg3': 'uint64',
509            'arg4': 'uint64',
510            'arg5': 'uint64' } }
513 # @S390CrashReason:
515 # Reason why the CPU is in a crashed state.
517 # @unknown: no crash reason was set
519 # @disabled-wait: the CPU has entered a disabled wait state
521 # @extint-loop: clock comparator or cpu timer interrupt with new PSW enabled
522 #               for external interrupts
524 # @pgmint-loop: program interrupt with BAD new PSW
526 # @opint-loop: operation exception interrupt with invalid code at the program
527 #              interrupt new PSW
529 # Since: 2.12
531 { 'enum': 'S390CrashReason',
532   'data': [ 'unknown',
533             'disabled-wait',
534             'extint-loop',
535             'pgmint-loop',
536             'opint-loop' ] }
539 # @GuestPanicInformationS390:
541 # S390 specific guest panic information (PSW)
543 # @core: core id of the CPU that crashed
544 # @psw-mask: control fields of guest PSW
545 # @psw-addr: guest instruction address
546 # @reason: guest crash reason
548 # Since: 2.12
550 {'struct': 'GuestPanicInformationS390',
551  'data': { 'core': 'uint32',
552            'psw-mask': 'uint64',
553            'psw-addr': 'uint64',
554            'reason': 'S390CrashReason' } }
557 # @MEMORY_FAILURE:
559 # Emitted when a memory failure occurs on host side.
561 # @recipient: recipient is defined as @MemoryFailureRecipient.
563 # @action: action that has been taken. action is defined as @MemoryFailureAction.
565 # @flags: flags for MemoryFailureAction. action is defined as @MemoryFailureFlags.
567 # Since: 5.2
569 # Example:
571 # <- { "event": "MEMORY_FAILURE",
572 #      "data": { "recipient": "hypervisor",
573 #                "action": "fatal",
574 #                "flags": { "action-required": false,
575 #                           "recursive": false } },
576 #      "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
579 { 'event': 'MEMORY_FAILURE',
580   'data': { 'recipient': 'MemoryFailureRecipient',
581             'action': 'MemoryFailureAction',
582             'flags': 'MemoryFailureFlags'} }
585 # @MemoryFailureRecipient:
587 # Hardware memory failure occurs, handled by recipient.
589 # @hypervisor: memory failure at QEMU process address space.
590 #              (none guest memory, but used by QEMU itself).
592 # @guest: memory failure at guest memory,
594 # Since: 5.2
596 { 'enum': 'MemoryFailureRecipient',
597   'data': [ 'hypervisor',
598             'guest' ] }
601 # @MemoryFailureAction:
603 # Actions taken by QEMU in response to a hardware memory failure.
605 # @ignore: the memory failure could be ignored.  This will only be the case
606 #          for action-optional failures.
608 # @inject: memory failure occurred in guest memory, the guest enabled MCE
609 #          handling mechanism, and QEMU could inject the MCE into the guest
610 #          successfully.
612 # @fatal: the failure is unrecoverable.  This occurs for action-required
613 #         failures if the recipient is the hypervisor; QEMU will exit.
615 # @reset: the failure is unrecoverable but confined to the guest.  This
616 #         occurs if the recipient is a guest guest which is not ready
617 #         to handle memory failures.
619 # Since: 5.2
621 { 'enum': 'MemoryFailureAction',
622   'data': [ 'ignore',
623             'inject',
624             'fatal',
625             'reset' ] }
628 # @MemoryFailureFlags:
630 # Additional information on memory failures.
632 # @action-required: whether a memory failure event is action-required
633 #                   or action-optional (e.g. a failure during memory scrub).
635 # @recursive: whether the failure occurred while the previous
636 #             failure was still in progress.
638 # Since: 5.2
640 { 'struct': 'MemoryFailureFlags',
641   'data': { 'action-required': 'bool',
642             'recursive': 'bool'} }