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
116 { 'struct': 'StatusInfo',
117 'data': {'running': 'bool',
118 'status': 'RunState'} }
123 # Query the run status of the VM
125 # Returns: @StatusInfo reflecting the VM
131 # -> { "execute": "query-status" }
132 # <- { "return": { "running": true,
133 # "status": "running" } }
135 { 'command': 'query-status', 'returns': 'StatusInfo',
136 'allow-preconfig': true }
141 # Emitted when the virtual machine has shut down, indicating that qemu
144 # @guest: If true, the shutdown was triggered by a guest request (such
145 # as a guest-initiated ACPI shutdown request or other
146 # hardware-specific action) rather than a host request (such as
147 # sending qemu a SIGINT). (since 2.10)
149 # @reason: The @ShutdownCause which resulted in the SHUTDOWN. (since
152 # Note: If the command-line option "-no-shutdown" has been specified,
153 # qemu will not exit, and a STOP event will eventually follow the
160 # <- { "event": "SHUTDOWN",
161 # "data": { "guest": true, "reason": "guest-shutdown" },
162 # "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
164 { 'event': 'SHUTDOWN', 'data': { 'guest': 'bool', 'reason': 'ShutdownCause' } }
169 # Emitted when the virtual machine is powered down through the power
170 # control system, such as via ACPI.
176 # <- { "event": "POWERDOWN",
177 # "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
179 { 'event': 'POWERDOWN' }
184 # Emitted when the virtual machine is reset
186 # @guest: If true, the reset was triggered by a guest request (such as
187 # a guest-initiated ACPI reboot request or other hardware-specific
188 # action) rather than a host request (such as the QMP command
189 # system_reset). (since 2.10)
191 # @reason: The @ShutdownCause of the RESET. (since 4.0)
197 # <- { "event": "RESET",
198 # "data": { "guest": false, "reason": "guest-reset" },
199 # "timestamp": { "seconds": 1267041653, "microseconds": 9518 } }
201 { 'event': 'RESET', 'data': { 'guest': 'bool', 'reason': 'ShutdownCause' } }
206 # Emitted when the virtual machine is stopped
212 # <- { "event": "STOP",
213 # "timestamp": { "seconds": 1267041730, "microseconds": 281295 } }
220 # Emitted when the virtual machine resumes execution
226 # <- { "event": "RESUME",
227 # "timestamp": { "seconds": 1271770767, "microseconds": 582542 } }
229 { 'event': 'RESUME' }
234 # Emitted when guest enters a hardware suspension state, for example,
235 # S3 state, which is sometimes called standby state
241 # <- { "event": "SUSPEND",
242 # "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
244 { 'event': 'SUSPEND' }
249 # Emitted when guest enters a hardware suspension state with data
250 # saved on disk, for example, S4 state, which is sometimes called
253 # Note: QEMU shuts down (similar to event @SHUTDOWN) when entering
260 # <- { "event": "SUSPEND_DISK",
261 # "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
263 { 'event': 'SUSPEND_DISK' }
268 # Emitted when the guest has woken up from suspend state and is
275 # <- { "event": "WAKEUP",
276 # "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
278 { 'event': 'WAKEUP' }
283 # Emitted when the watchdog device's timer is expired
285 # @action: action that has been taken
287 # Note: If action is "reset", "shutdown", or "pause" the WATCHDOG
288 # event is followed respectively by the RESET, SHUTDOWN, or STOP
291 # Note: This event is rate-limited.
297 # <- { "event": "WATCHDOG",
298 # "data": { "action": "reset" },
299 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
301 { 'event': 'WATCHDOG',
302 'data': { 'action': 'WatchdogAction' } }
307 # An enumeration of the actions taken when the watchdog device's timer
310 # @reset: system resets
312 # @shutdown: system shutdown, note that it is similar to @powerdown,
313 # which tries to set to system status and notify guest
315 # @poweroff: system poweroff, the emulator program exits
317 # @pause: system pauses, similar to @stop
319 # @debug: system enters debug state
321 # @none: nothing is done
323 # @inject-nmi: a non-maskable interrupt is injected into the first
324 # VCPU (all VCPUS on x86) (since 2.4)
328 { 'enum': 'WatchdogAction',
329 'data': [ 'reset', 'shutdown', 'poweroff', 'pause', 'debug', 'none',
335 # Possible QEMU actions upon guest reboot
337 # @reset: Reset the VM
339 # @shutdown: Shutdown the VM and exit, according to the shutdown
344 { 'enum': 'RebootAction',
345 'data': [ 'reset', 'shutdown' ] }
350 # Possible QEMU actions upon guest shutdown
352 # @poweroff: Shutdown the VM and exit
354 # @pause: pause the VM
358 { 'enum': 'ShutdownAction',
359 'data': [ 'poweroff', 'pause' ] }
364 # @none: Continue VM execution
366 # @pause: Pause the VM
368 # @shutdown: Shutdown the VM and exit, according to the shutdown
371 # @exit-failure: Shutdown the VM and exit with nonzero status (since
376 { 'enum': 'PanicAction',
377 'data': [ 'pause', 'shutdown', 'exit-failure', 'none' ] }
380 # @watchdog-set-action:
382 # Set watchdog action
386 { 'command': 'watchdog-set-action', 'data' : {'action': 'WatchdogAction'} }
391 # Set the actions that will be taken by the emulator in response to
394 # @reboot: @RebootAction action taken on guest reboot.
396 # @shutdown: @ShutdownAction action taken on guest shutdown.
398 # @panic: @PanicAction action taken on guest panic.
400 # @watchdog: @WatchdogAction action taken when watchdog timer expires
403 # Returns: Nothing on success.
409 # -> { "execute": "set-action",
410 # "arguments": { "reboot": "shutdown",
411 # "shutdown" : "pause",
413 # "watchdog": "inject-nmi" } }
414 # <- { "return": {} }
416 { 'command': 'set-action',
417 'data': { '*reboot': 'RebootAction',
418 '*shutdown': 'ShutdownAction',
419 '*panic': 'PanicAction',
420 '*watchdog': 'WatchdogAction' },
421 'allow-preconfig': true }
426 # Emitted when guest OS panic is detected
428 # @action: action that has been taken, currently always "pause"
430 # @info: information about a panic (since 2.9)
436 # <- { "event": "GUEST_PANICKED",
437 # "data": { "action": "pause" },
438 # "timestamp": { "seconds": 1648245231, "microseconds": 900001 } }
440 { 'event': 'GUEST_PANICKED',
441 'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } }
444 # @GUEST_CRASHLOADED:
446 # Emitted when guest OS crash loaded is detected
448 # @action: action that has been taken, currently always "run"
450 # @info: information about a panic
456 # <- { "event": "GUEST_CRASHLOADED",
457 # "data": { "action": "run" },
458 # "timestamp": { "seconds": 1648245259, "microseconds": 893771 } }
460 { 'event': 'GUEST_CRASHLOADED',
461 'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } }
466 # An enumeration of the actions taken when guest OS panic is detected
468 # @pause: system pauses
470 # @poweroff: system powers off (since 2.8)
472 # @run: system continues to run (since 5.0)
476 { 'enum': 'GuestPanicAction',
477 'data': [ 'pause', 'poweroff', 'run' ] }
480 # @GuestPanicInformationType:
482 # An enumeration of the guest panic information types
484 # @hyper-v: hyper-v guest panic information type
486 # @s390: s390 guest panic information type (Since: 2.12)
490 { 'enum': 'GuestPanicInformationType',
491 'data': [ 'hyper-v', 's390' ] }
494 # @GuestPanicInformation:
496 # Information about a guest panic
498 # @type: Crash type that defines the hypervisor specific information
502 {'union': 'GuestPanicInformation',
503 'base': {'type': 'GuestPanicInformationType'},
504 'discriminator': 'type',
505 'data': {'hyper-v': 'GuestPanicInformationHyperV',
506 's390': 'GuestPanicInformationS390'}}
509 # @GuestPanicInformationHyperV:
511 # Hyper-V specific guest panic information (HV crash MSRs)
515 {'struct': 'GuestPanicInformationHyperV',
516 'data': {'arg1': 'uint64',
525 # Reason why the CPU is in a crashed state.
527 # @unknown: no crash reason was set
529 # @disabled-wait: the CPU has entered a disabled wait state
531 # @extint-loop: clock comparator or cpu timer interrupt with new PSW
532 # enabled for external interrupts
534 # @pgmint-loop: program interrupt with BAD new PSW
536 # @opint-loop: operation exception interrupt with invalid code at the
537 # program interrupt new PSW
541 { 'enum': 'S390CrashReason',
549 # @GuestPanicInformationS390:
551 # S390 specific guest panic information (PSW)
553 # @core: core id of the CPU that crashed
555 # @psw-mask: control fields of guest PSW
557 # @psw-addr: guest instruction address
559 # @reason: guest crash reason
563 {'struct': 'GuestPanicInformationS390',
564 'data': {'core': 'uint32',
565 'psw-mask': 'uint64',
566 'psw-addr': 'uint64',
567 'reason': 'S390CrashReason'}}
572 # Emitted when a memory failure occurs on host side.
574 # @recipient: recipient is defined as @MemoryFailureRecipient.
576 # @action: action that has been taken. action is defined as
577 # @MemoryFailureAction.
579 # @flags: flags for MemoryFailureAction. action is defined as
580 # @MemoryFailureFlags.
586 # <- { "event": "MEMORY_FAILURE",
587 # "data": { "recipient": "hypervisor",
589 # "flags": { "action-required": false,
590 # "recursive": false } },
591 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
593 { 'event': 'MEMORY_FAILURE',
594 'data': { 'recipient': 'MemoryFailureRecipient',
595 'action': 'MemoryFailureAction',
596 'flags': 'MemoryFailureFlags'} }
599 # @MemoryFailureRecipient:
601 # Hardware memory failure occurs, handled by recipient.
603 # @hypervisor: memory failure at QEMU process address space. (none
604 # guest memory, but used by QEMU itself).
606 # @guest: memory failure at guest memory,
610 { 'enum': 'MemoryFailureRecipient',
611 'data': [ 'hypervisor',
615 # @MemoryFailureAction:
617 # Actions taken by QEMU in response to a hardware memory failure.
619 # @ignore: the memory failure could be ignored. This will only be the
620 # case for action-optional failures.
622 # @inject: memory failure occurred in guest memory, the guest enabled
623 # MCE handling mechanism, and QEMU could inject the MCE into the
624 # guest successfully.
626 # @fatal: the failure is unrecoverable. This occurs for
627 # action-required failures if the recipient is the hypervisor;
630 # @reset: the failure is unrecoverable but confined to the guest.
631 # This occurs if the recipient is a guest guest which is not ready
632 # to handle memory failures.
636 { 'enum': 'MemoryFailureAction',
643 # @MemoryFailureFlags:
645 # Additional information on memory failures.
647 # @action-required: whether a memory failure event is action-required
648 # or action-optional (e.g. a failure during memory scrub).
650 # @recursive: whether the failure occurred while the previous failure
651 # was still in progress.
655 { 'struct': 'MemoryFailureFlags',
656 'data': { 'action-required': 'bool',
657 'recursive': 'bool'} }
660 # @NotifyVmexitOption:
662 # An enumeration of the options specified when enabling notify VM exit
664 # @run: enable the feature, do nothing and continue if the notify VM
667 # @internal-error: enable the feature, raise a internal error if the
668 # notify VM exit happens.
670 # @disable: disable the feature.
674 { 'enum': 'NotifyVmexitOption',
675 'data': [ 'run', 'internal-error', 'disable' ] }