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
24 # @internal-error: An internal error that prevents further guest execution
27 # @io-error: the last IOP has failed and the device is configured to pause
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)
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' ] }
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
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
89 # @snapshot-load: A snapshot is being loaded by the record & replay
90 # subsystem. This value is used only within QEMU. It
91 # doesn't occur in QMP. (since 7.2)
94 { 'enum': 'ShutdownCause',
95 # Beware, shutdown_caused_by_guest() depends on enumeration order
96 'data': [ 'none', 'host-error', 'host-qmp-quit', 'host-qmp-system-reset',
97 'host-signal', 'host-ui', 'guest-shutdown', 'guest-reset',
98 'guest-panic', 'subsystem-reset', 'snapshot-load'] }
103 # Information about VCPU run state
105 # @running: true if all VCPUs are runnable, false if not runnable
107 # @singlestep: true if VCPUs are in single-step mode
109 # @status: the virtual machine @RunState
113 # Notes: @singlestep is enabled through the GDB stub
115 { 'struct': 'StatusInfo',
116 'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
121 # Query the run status of all VCPUs
123 # Returns: @StatusInfo reflecting all VCPUs
129 # -> { "execute": "query-status" }
130 # <- { "return": { "running": true,
131 # "singlestep": false,
132 # "status": "running" } }
135 { 'command': 'query-status', 'returns': 'StatusInfo',
136 'allow-preconfig': true }
141 # Emitted when the virtual machine has shut down, indicating that qemu is
144 # @guest: If true, the shutdown was triggered by a guest request (such as
145 # a guest-initiated ACPI shutdown request or other hardware-specific action)
146 # rather than a host request (such as sending qemu a SIGINT). (since 2.10)
148 # @reason: The @ShutdownCause which resulted in the SHUTDOWN. (since 4.0)
150 # Note: If the command-line option "-no-shutdown" has been specified, qemu will
151 # not exit, and a STOP event will eventually follow the SHUTDOWN event
157 # <- { "event": "SHUTDOWN",
158 # "data": { "guest": true, "reason": "guest-shutdown" },
159 # "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 control
168 # system, such as via ACPI.
174 # <- { "event": "POWERDOWN",
175 # "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
178 { 'event': 'POWERDOWN' }
183 # Emitted when the virtual machine is reset
185 # @guest: If true, the reset was triggered by a guest request (such as
186 # a guest-initiated ACPI reboot request or other hardware-specific action)
187 # rather than a host request (such as the QMP command system_reset).
190 # @reason: The @ShutdownCause of the RESET. (since 4.0)
196 # <- { "event": "RESET",
197 # "data": { "guest": false, "reason": "guest-reset" },
198 # "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 } }
221 # Emitted when the virtual machine resumes execution
227 # <- { "event": "RESUME",
228 # "timestamp": { "seconds": 1271770767, "microseconds": 582542 } }
231 { 'event': 'RESUME' }
236 # Emitted when guest enters a hardware suspension state, for example, S3 state,
237 # which is sometimes called standby state
243 # <- { "event": "SUSPEND",
244 # "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
247 { 'event': 'SUSPEND' }
252 # Emitted when guest enters a hardware suspension state with data saved on
253 # disk, for example, S4 state, which is sometimes called hibernate state
255 # Note: QEMU shuts down (similar to event @SHUTDOWN) when entering this state
261 # <- { "event": "SUSPEND_DISK",
262 # "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
264 { 'event': 'SUSPEND_DISK' }
269 # Emitted when the guest has woken up from suspend state and is running
275 # <- { "event": "WAKEUP",
276 # "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
279 { 'event': 'WAKEUP' }
284 # Emitted when the watchdog device's timer is expired
286 # @action: action that has been taken
288 # Note: If action is "reset", "shutdown", or "pause" the WATCHDOG event is
289 # followed respectively by the RESET, SHUTDOWN, or STOP events
291 # Note: This event is rate-limited.
297 # <- { "event": "WATCHDOG",
298 # "data": { "action": "reset" },
299 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
302 { 'event': 'WATCHDOG',
303 'data': { 'action': 'WatchdogAction' } }
308 # An enumeration of the actions taken when the watchdog device's timer is
311 # @reset: system resets
313 # @shutdown: system shutdown, note that it is similar to @powerdown, which
314 # tries to set to system status and notify guest
316 # @poweroff: system poweroff, the emulator program exits
318 # @pause: system pauses, similar to @stop
320 # @debug: system enters debug state
322 # @none: nothing is done
324 # @inject-nmi: a non-maskable interrupt is injected into the first VCPU (all
325 # VCPUS on x86) (since 2.4)
329 { 'enum': 'WatchdogAction',
330 'data': [ 'reset', 'shutdown', 'poweroff', 'pause', 'debug', 'none',
336 # Possible QEMU actions upon guest reboot
338 # @reset: Reset the VM
340 # @shutdown: Shutdown the VM and exit, according to the shutdown action
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 action
370 # @exit-failure: Shutdown the VM and exit with nonzero status
375 { 'enum': 'PanicAction',
376 'data': [ 'pause', 'shutdown', 'exit-failure', 'none' ] }
379 # @watchdog-set-action:
381 # Set watchdog action
385 { 'command': 'watchdog-set-action', 'data' : {'action': 'WatchdogAction'} }
390 # Set the actions that will be taken by the emulator in response to guest
393 # @reboot: @RebootAction action taken on guest reboot.
395 # @shutdown: @ShutdownAction action taken on guest shutdown.
397 # @panic: @PanicAction action taken on guest panic.
399 # @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 } }
439 { 'event': 'GUEST_PANICKED',
440 'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } }
443 # @GUEST_CRASHLOADED:
445 # Emitted when guest OS crash loaded is detected
447 # @action: action that has been taken, currently always "run"
449 # @info: information about a panic
455 # <- { "event": "GUEST_CRASHLOADED",
456 # "data": { "action": "run" },
457 # "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 enabled
532 # for external interrupts
534 # @pgmint-loop: program interrupt with BAD new PSW
536 # @opint-loop: operation exception interrupt with invalid code at the program
541 { 'enum': 'S390CrashReason',
549 # @GuestPanicInformationS390:
551 # S390 specific guest panic information (PSW)
553 # @core: core id of the CPU that crashed
554 # @psw-mask: control fields of guest PSW
555 # @psw-addr: guest instruction address
556 # @reason: guest crash reason
560 {'struct': 'GuestPanicInformationS390',
561 'data': { 'core': 'uint32',
562 'psw-mask': 'uint64',
563 'psw-addr': 'uint64',
564 'reason': 'S390CrashReason' } }
569 # Emitted when a memory failure occurs on host side.
571 # @recipient: recipient is defined as @MemoryFailureRecipient.
573 # @action: action that has been taken. action is defined as @MemoryFailureAction.
575 # @flags: flags for MemoryFailureAction. action is defined as @MemoryFailureFlags.
581 # <- { "event": "MEMORY_FAILURE",
582 # "data": { "recipient": "hypervisor",
584 # "flags": { "action-required": false,
585 # "recursive": false } },
586 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
589 { 'event': 'MEMORY_FAILURE',
590 'data': { 'recipient': 'MemoryFailureRecipient',
591 'action': 'MemoryFailureAction',
592 'flags': 'MemoryFailureFlags'} }
595 # @MemoryFailureRecipient:
597 # Hardware memory failure occurs, handled by recipient.
599 # @hypervisor: memory failure at QEMU process address space.
600 # (none guest memory, but used by QEMU itself).
602 # @guest: memory failure at guest memory,
606 { 'enum': 'MemoryFailureRecipient',
607 'data': [ 'hypervisor',
611 # @MemoryFailureAction:
613 # Actions taken by QEMU in response to a hardware memory failure.
615 # @ignore: the memory failure could be ignored. This will only be the case
616 # for action-optional failures.
618 # @inject: memory failure occurred in guest memory, the guest enabled MCE
619 # handling mechanism, and QEMU could inject the MCE into the guest
622 # @fatal: the failure is unrecoverable. This occurs for action-required
623 # failures if the recipient is the hypervisor; QEMU will exit.
625 # @reset: the failure is unrecoverable but confined to the guest. This
626 # 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
646 # failure 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 exit happens.
661 # @internal-error: enable the feature, raise a internal error if the notify
664 # @disable: disable the feature.
668 { 'enum': 'NotifyVmexitOption',
669 'data': [ 'run', 'internal-error', 'disable' ] }