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
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
49 # @guest-panicked: guest has been panicked as a result of guest OS
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)
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' ] }
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
85 # @guest-panic: Guest panicked, and command line turns that into a
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'] }
105 # Information about VM run state
107 # @running: true if all VCPUs are runnable, false if not runnable
109 # @status: the virtual machine @RunState
114 { 'struct': 'StatusInfo',
115 'data': {'running': 'bool',
116 'status': 'RunState'} }
121 # Query the run status of the VM
123 # Returns: @StatusInfo reflecting the VM
129 # -> { "execute": "query-status" }
130 # <- { "return": { "running": true,
131 # "status": "running" } }
133 { 'command': 'query-status', 'returns': 'StatusInfo',
134 'allow-preconfig': true }
139 # Emitted when the virtual machine has shut down, indicating that qemu
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
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
158 # <- { "event": "SHUTDOWN",
159 # "data": { "guest": true, "reason": "guest-shutdown" },
160 # "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
162 { 'event': 'SHUTDOWN', 'data': { 'guest': 'bool', 'reason': 'ShutdownCause' } }
167 # Emitted when the virtual machine is powered down through the power
168 # control system, such as via ACPI.
174 # <- { "event": "POWERDOWN",
175 # "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
177 { 'event': 'POWERDOWN' }
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)
195 # <- { "event": "RESET",
196 # "data": { "guest": false, "reason": "guest-reset" },
197 # "timestamp": { "seconds": 1267041653, "microseconds": 9518 } }
199 { 'event': 'RESET', 'data': { 'guest': 'bool', 'reason': 'ShutdownCause' } }
204 # Emitted when the virtual machine is stopped
210 # <- { "event": "STOP",
211 # "timestamp": { "seconds": 1267041730, "microseconds": 281295 } }
218 # Emitted when the virtual machine resumes execution
224 # <- { "event": "RESUME",
225 # "timestamp": { "seconds": 1271770767, "microseconds": 582542 } }
227 { 'event': 'RESUME' }
232 # Emitted when guest enters a hardware suspension state, for example,
233 # S3 state, which is sometimes called standby state
239 # <- { "event": "SUSPEND",
240 # "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
242 { 'event': 'SUSPEND' }
247 # Emitted when guest enters a hardware suspension state with data
248 # saved on disk, for example, S4 state, which is sometimes called
251 # Note: QEMU shuts down (similar to event @SHUTDOWN) when entering
258 # <- { "event": "SUSPEND_DISK",
259 # "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
261 { 'event': 'SUSPEND_DISK' }
266 # Emitted when the guest has woken up from suspend state and is
273 # <- { "event": "WAKEUP",
274 # "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
276 { 'event': 'WAKEUP' }
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
289 # Note: This event is rate-limited.
295 # <- { "event": "WATCHDOG",
296 # "data": { "action": "reset" },
297 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
299 { 'event': 'WATCHDOG',
300 'data': { 'action': 'WatchdogAction' } }
305 # An enumeration of the actions taken when the watchdog device's timer
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)
326 { 'enum': 'WatchdogAction',
327 'data': [ 'reset', 'shutdown', 'poweroff', 'pause', 'debug', 'none',
333 # Possible QEMU actions upon guest reboot
335 # @reset: Reset the VM
337 # @shutdown: Shutdown the VM and exit, according to the shutdown
342 { 'enum': 'RebootAction',
343 'data': [ 'reset', 'shutdown' ] }
348 # Possible QEMU actions upon guest shutdown
350 # @poweroff: Shutdown the VM and exit
352 # @pause: pause the VM
356 { 'enum': 'ShutdownAction',
357 'data': [ 'poweroff', 'pause' ] }
362 # @none: Continue VM execution
364 # @pause: Pause the VM
366 # @shutdown: Shutdown the VM and exit, according to the shutdown
369 # @exit-failure: Shutdown the VM and exit with nonzero status (since
374 { 'enum': 'PanicAction',
375 'data': [ 'pause', 'shutdown', 'exit-failure', 'none' ] }
378 # @watchdog-set-action:
380 # Set watchdog action
384 { 'command': 'watchdog-set-action', 'data' : {'action': 'WatchdogAction'} }
389 # Set the actions that will be taken by the emulator in response to
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.
404 # -> { "execute": "set-action",
405 # "arguments": { "reboot": "shutdown",
406 # "shutdown" : "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 }
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)
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
451 # <- { "event": "GUEST_CRASHLOADED",
452 # "data": { "action": "run" },
453 # "timestamp": { "seconds": 1648245259, "microseconds": 893771 } }
455 { 'event': 'GUEST_CRASHLOADED',
456 'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } }
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)
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)
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
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)
510 {'struct': 'GuestPanicInformationHyperV',
511 'data': {'arg1': 'uint64',
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
536 { 'enum': 'S390CrashReason',
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
558 {'struct': 'GuestPanicInformationS390',
559 'data': {'core': 'uint32',
560 'psw-mask': 'uint64',
561 'psw-addr': 'uint64',
562 'reason': 'S390CrashReason'}}
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.
581 # <- { "event": "MEMORY_FAILURE",
582 # "data": { "recipient": "hypervisor",
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,
605 { 'enum': 'MemoryFailureRecipient',
606 'data': [ 'hypervisor',
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;
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.
631 { 'enum': 'MemoryFailureAction',
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.
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
662 # @internal-error: enable the feature, raise a internal error if the
663 # notify VM exit happens.
665 # @disable: disable the feature.
669 { 'enum': 'NotifyVmexitOption',
670 'data': [ 'run', 'internal-error', 'disable' ] }