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
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'] }
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
109 # Notes: @singlestep is enabled through the GDB stub
111 { 'struct': 'StatusInfo',
112 'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
117 # Query the run status of all VCPUs
119 # Returns: @StatusInfo reflecting all VCPUs
125 # -> { "execute": "query-status" }
126 # <- { "return": { "running": true,
127 # "singlestep": false,
128 # "status": "running" } }
131 { 'command': 'query-status', 'returns': 'StatusInfo',
132 'allow-preconfig': true }
137 # Emitted when the virtual machine has shut down, indicating that qemu is
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
153 # <- { "event": "SHUTDOWN",
154 # "data": { "guest": true, "reason": "guest-shutdown" },
155 # "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
158 { 'event': 'SHUTDOWN', 'data': { 'guest': 'bool', 'reason': 'ShutdownCause' } }
163 # Emitted when the virtual machine is powered down through the power control
164 # system, such as via ACPI.
170 # <- { "event": "POWERDOWN",
171 # "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
174 { 'event': 'POWERDOWN' }
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).
186 # @reason: The @ShutdownCause of the RESET. (since 4.0)
192 # <- { "event": "RESET",
193 # "data": { "guest": false, "reason": "guest-reset" },
194 # "timestamp": { "seconds": 1267041653, "microseconds": 9518 } }
197 { 'event': 'RESET', 'data': { 'guest': 'bool', 'reason': 'ShutdownCause' } }
202 # Emitted when the virtual machine is stopped
208 # <- { "event": "STOP",
209 # "timestamp": { "seconds": 1267041730, "microseconds": 281295 } }
217 # Emitted when the virtual machine resumes execution
223 # <- { "event": "RESUME",
224 # "timestamp": { "seconds": 1271770767, "microseconds": 582542 } }
227 { 'event': 'RESUME' }
232 # Emitted when guest enters a hardware suspension state, for example, S3 state,
233 # which is sometimes called standby state
239 # <- { "event": "SUSPEND",
240 # "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
243 { 'event': 'SUSPEND' }
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
257 # <- { "event": "SUSPEND_DISK",
258 # "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
261 { 'event': 'SUSPEND_DISK' }
266 # Emitted when the guest has woken up from suspend state and is running
272 # <- { "event": "WAKEUP",
273 # "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 event is
286 # followed respectively by the RESET, SHUTDOWN, or STOP events
288 # Note: This event is rate-limited.
294 # <- { "event": "WATCHDOG",
295 # "data": { "action": "reset" },
296 # "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 is
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)
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 action
341 { 'enum': 'RebootAction',
342 'data': [ 'reset', 'shutdown' ] }
347 # Possible QEMU actions upon guest shutdown
349 # @poweroff: Shutdown the VM and exit
351 # @pause: pause the VM
355 { 'enum': 'ShutdownAction',
356 'data': [ 'poweroff', 'pause' ] }
361 # @none: Continue VM execution
363 # @pause: Pause the VM
365 # @shutdown: Shutdown the VM and exit, according to the shutdown action
367 # @exit-failure: Shutdown the VM and exit with nonzero status
372 { 'enum': 'PanicAction',
373 'data': [ 'pause', 'shutdown', 'exit-failure', 'none' ] }
376 # @watchdog-set-action:
378 # Set watchdog action
382 { 'command': 'watchdog-set-action', 'data' : {'action': 'WatchdogAction'} }
387 # Set the actions that will be taken by the emulator in response to guest
390 # @reboot: @RebootAction action taken on guest reboot.
392 # @shutdown: @ShutdownAction action taken on guest shutdown.
394 # @panic: @PanicAction action taken on guest panic.
396 # @watchdog: @WatchdogAction action taken when watchdog timer expires .
398 # Returns: Nothing on success.
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 } }
436 { 'event': 'GUEST_PANICKED',
437 'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } }
440 # @GUEST_CRASHLOADED:
442 # Emitted when guest OS crash loaded is detected
444 # @action: action that has been taken, currently always "run"
446 # @info: information about a panic
452 # <- { "event": "GUEST_CRASHLOADED",
453 # "data": { "action": "run" },
454 # "timestamp": { "seconds": 1648245259, "microseconds": 893771 } }
457 { 'event': 'GUEST_CRASHLOADED',
458 'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } }
463 # An enumeration of the actions taken when guest OS panic is detected
465 # @pause: system pauses
467 # Since: 2.1 (poweroff since 2.8, run since 5.0)
469 { 'enum': 'GuestPanicAction',
470 'data': [ 'pause', 'poweroff', 'run' ] }
473 # @GuestPanicInformationType:
475 # An enumeration of the guest panic information types
477 # @hyper-v: hyper-v guest panic information type
479 # @s390: s390 guest panic information type (Since: 2.12)
483 { 'enum': 'GuestPanicInformationType',
484 'data': [ 'hyper-v', 's390' ] }
487 # @GuestPanicInformation:
489 # Information about a guest panic
491 # @type: Crash type that defines the hypervisor specific information
495 {'union': 'GuestPanicInformation',
496 'base': {'type': 'GuestPanicInformationType'},
497 'discriminator': 'type',
498 'data': { 'hyper-v': 'GuestPanicInformationHyperV',
499 's390': 'GuestPanicInformationS390' } }
502 # @GuestPanicInformationHyperV:
504 # Hyper-V specific guest panic information (HV crash MSRs)
508 {'struct': 'GuestPanicInformationHyperV',
509 'data': { 'arg1': 'uint64',
518 # Reason why the CPU is in a crashed state.
520 # @unknown: no crash reason was set
522 # @disabled-wait: the CPU has entered a disabled wait state
524 # @extint-loop: clock comparator or cpu timer interrupt with new PSW enabled
525 # for external interrupts
527 # @pgmint-loop: program interrupt with BAD new PSW
529 # @opint-loop: operation exception interrupt with invalid code at the program
534 { 'enum': 'S390CrashReason',
542 # @GuestPanicInformationS390:
544 # S390 specific guest panic information (PSW)
546 # @core: core id of the CPU that crashed
547 # @psw-mask: control fields of guest PSW
548 # @psw-addr: guest instruction address
549 # @reason: guest crash reason
553 {'struct': 'GuestPanicInformationS390',
554 'data': { 'core': 'uint32',
555 'psw-mask': 'uint64',
556 'psw-addr': 'uint64',
557 'reason': 'S390CrashReason' } }
562 # Emitted when a memory failure occurs on host side.
564 # @recipient: recipient is defined as @MemoryFailureRecipient.
566 # @action: action that has been taken. action is defined as @MemoryFailureAction.
568 # @flags: flags for MemoryFailureAction. action is defined as @MemoryFailureFlags.
574 # <- { "event": "MEMORY_FAILURE",
575 # "data": { "recipient": "hypervisor",
577 # "flags": { "action-required": false,
578 # "recursive": false } },
579 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
582 { 'event': 'MEMORY_FAILURE',
583 'data': { 'recipient': 'MemoryFailureRecipient',
584 'action': 'MemoryFailureAction',
585 'flags': 'MemoryFailureFlags'} }
588 # @MemoryFailureRecipient:
590 # Hardware memory failure occurs, handled by recipient.
592 # @hypervisor: memory failure at QEMU process address space.
593 # (none guest memory, but used by QEMU itself).
595 # @guest: memory failure at guest memory,
599 { 'enum': 'MemoryFailureRecipient',
600 'data': [ 'hypervisor',
604 # @MemoryFailureAction:
606 # Actions taken by QEMU in response to a hardware memory failure.
608 # @ignore: the memory failure could be ignored. This will only be the case
609 # for action-optional failures.
611 # @inject: memory failure occurred in guest memory, the guest enabled MCE
612 # handling mechanism, and QEMU could inject the MCE into the guest
615 # @fatal: the failure is unrecoverable. This occurs for action-required
616 # failures if the recipient is the hypervisor; QEMU will exit.
618 # @reset: the failure is unrecoverable but confined to the guest. This
619 # occurs if the recipient is a guest guest which is not ready
620 # to handle memory failures.
624 { 'enum': 'MemoryFailureAction',
631 # @MemoryFailureFlags:
633 # Additional information on memory failures.
635 # @action-required: whether a memory failure event is action-required
636 # or action-optional (e.g. a failure during memory scrub).
638 # @recursive: whether the failure occurred while the previous
639 # failure was still in progress.
643 { 'struct': 'MemoryFailureFlags',
644 'data': { 'action-required': 'bool',
645 'recursive': 'bool'} }
648 # @NotifyVmexitOption:
650 # An enumeration of the options specified when enabling notify VM exit
652 # @run: enable the feature, do nothing and continue if the notify VM exit happens.
654 # @internal-error: enable the feature, raise a internal error if the notify
657 # @disable: disable the feature.
661 { 'enum': 'NotifyVmexitOption',
662 'data': [ 'run', 'internal-error', 'disable' ] }