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
401 # Returns: Nothing on success.
407 # -> { "execute": "set-action",
408 # "arguments": { "reboot": "shutdown",
409 # "shutdown" : "pause",
411 # "watchdog": "inject-nmi" } }
412 # <- { "return": {} }
414 { 'command': 'set-action',
415 'data': { '*reboot': 'RebootAction',
416 '*shutdown': 'ShutdownAction',
417 '*panic': 'PanicAction',
418 '*watchdog': 'WatchdogAction' },
419 'allow-preconfig': true }
424 # Emitted when guest OS panic is detected
426 # @action: action that has been taken, currently always "pause"
428 # @info: information about a panic (since 2.9)
434 # <- { "event": "GUEST_PANICKED",
435 # "data": { "action": "pause" },
436 # "timestamp": { "seconds": 1648245231, "microseconds": 900001 } }
438 { 'event': 'GUEST_PANICKED',
439 'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } }
442 # @GUEST_CRASHLOADED:
444 # Emitted when guest OS crash loaded is detected
446 # @action: action that has been taken, currently always "run"
448 # @info: information about a panic
454 # <- { "event": "GUEST_CRASHLOADED",
455 # "data": { "action": "run" },
456 # "timestamp": { "seconds": 1648245259, "microseconds": 893771 } }
458 { 'event': 'GUEST_CRASHLOADED',
459 'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } }
464 # An enumeration of the actions taken when guest OS panic is detected
466 # @pause: system pauses
468 # @poweroff: system powers off (since 2.8)
470 # @run: system continues to run (since 5.0)
474 { 'enum': 'GuestPanicAction',
475 'data': [ 'pause', 'poweroff', 'run' ] }
478 # @GuestPanicInformationType:
480 # An enumeration of the guest panic information types
482 # @hyper-v: hyper-v guest panic information type
484 # @s390: s390 guest panic information type (Since: 2.12)
488 { 'enum': 'GuestPanicInformationType',
489 'data': [ 'hyper-v', 's390' ] }
492 # @GuestPanicInformation:
494 # Information about a guest panic
496 # @type: Crash type that defines the hypervisor specific information
500 {'union': 'GuestPanicInformation',
501 'base': {'type': 'GuestPanicInformationType'},
502 'discriminator': 'type',
503 'data': {'hyper-v': 'GuestPanicInformationHyperV',
504 's390': 'GuestPanicInformationS390'}}
507 # @GuestPanicInformationHyperV:
509 # Hyper-V specific guest panic information (HV crash MSRs)
513 {'struct': 'GuestPanicInformationHyperV',
514 'data': {'arg1': 'uint64',
523 # Reason why the CPU is in a crashed state.
525 # @unknown: no crash reason was set
527 # @disabled-wait: the CPU has entered a disabled wait state
529 # @extint-loop: clock comparator or cpu timer interrupt with new PSW
530 # enabled for external interrupts
532 # @pgmint-loop: program interrupt with BAD new PSW
534 # @opint-loop: operation exception interrupt with invalid code at the
535 # program interrupt new PSW
539 { 'enum': 'S390CrashReason',
547 # @GuestPanicInformationS390:
549 # S390 specific guest panic information (PSW)
551 # @core: core id of the CPU that crashed
553 # @psw-mask: control fields of guest PSW
555 # @psw-addr: guest instruction address
557 # @reason: guest crash reason
561 {'struct': 'GuestPanicInformationS390',
562 'data': {'core': 'uint32',
563 'psw-mask': 'uint64',
564 'psw-addr': 'uint64',
565 'reason': 'S390CrashReason'}}
570 # Emitted when a memory failure occurs on host side.
572 # @recipient: recipient is defined as @MemoryFailureRecipient.
574 # @action: action that has been taken. action is defined as
575 # @MemoryFailureAction.
577 # @flags: flags for MemoryFailureAction. action is defined as
578 # @MemoryFailureFlags.
584 # <- { "event": "MEMORY_FAILURE",
585 # "data": { "recipient": "hypervisor",
587 # "flags": { "action-required": false,
588 # "recursive": false } },
589 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
591 { 'event': 'MEMORY_FAILURE',
592 'data': { 'recipient': 'MemoryFailureRecipient',
593 'action': 'MemoryFailureAction',
594 'flags': 'MemoryFailureFlags'} }
597 # @MemoryFailureRecipient:
599 # Hardware memory failure occurs, handled by recipient.
601 # @hypervisor: memory failure at QEMU process address space. (none
602 # guest memory, but used by QEMU itself).
604 # @guest: memory failure at guest memory,
608 { 'enum': 'MemoryFailureRecipient',
609 'data': [ 'hypervisor',
613 # @MemoryFailureAction:
615 # Actions taken by QEMU in response to a hardware memory failure.
617 # @ignore: the memory failure could be ignored. This will only be the
618 # case for action-optional failures.
620 # @inject: memory failure occurred in guest memory, the guest enabled
621 # MCE handling mechanism, and QEMU could inject the MCE into the
622 # guest successfully.
624 # @fatal: the failure is unrecoverable. This occurs for
625 # action-required failures if the recipient is the hypervisor;
628 # @reset: the failure is unrecoverable but confined to the guest.
629 # This occurs if the recipient is a guest guest which is not ready
630 # to handle memory failures.
634 { 'enum': 'MemoryFailureAction',
641 # @MemoryFailureFlags:
643 # Additional information on memory failures.
645 # @action-required: whether a memory failure event is action-required
646 # or action-optional (e.g. a failure during memory scrub).
648 # @recursive: whether the failure occurred while the previous failure
649 # was still in progress.
653 { 'struct': 'MemoryFailureFlags',
654 'data': { 'action-required': 'bool',
655 'recursive': 'bool'} }
658 # @NotifyVmexitOption:
660 # An enumeration of the options specified when enabling notify VM exit
662 # @run: enable the feature, do nothing and continue if the notify VM
665 # @internal-error: enable the feature, raise a internal error if the
666 # notify VM exit happens.
668 # @disable: disable the feature.
672 { 'enum': 'NotifyVmexitOption',
673 'data': [ 'run', 'internal-error', 'disable' ] }