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 # @singlestep: true if using TCG with one guest instruction per
112 # @status: the virtual machine @RunState
116 # @deprecated: Member 'singlestep' is deprecated (with no
121 # Notes: @singlestep is enabled on the command line with '-accel
122 # tcg,one-insn-per-tb=on', or with the HMP 'one-insn-per-tb'
125 { 'struct': 'StatusInfo',
126 'data': {'running': 'bool',
127 'singlestep': { 'type': 'bool', 'features': [ 'deprecated' ]},
128 'status': 'RunState'} }
133 # Query the run status of the VM
135 # Returns: @StatusInfo reflecting the VM
141 # -> { "execute": "query-status" }
142 # <- { "return": { "running": true,
143 # "singlestep": false,
144 # "status": "running" } }
146 { 'command': 'query-status', 'returns': 'StatusInfo',
147 'allow-preconfig': true }
152 # Emitted when the virtual machine has shut down, indicating that qemu
155 # @guest: If true, the shutdown was triggered by a guest request (such
156 # as a guest-initiated ACPI shutdown request or other
157 # hardware-specific action) rather than a host request (such as
158 # sending qemu a SIGINT). (since 2.10)
160 # @reason: The @ShutdownCause which resulted in the SHUTDOWN. (since
163 # Note: If the command-line option "-no-shutdown" has been specified,
164 # qemu will not exit, and a STOP event will eventually follow the
171 # <- { "event": "SHUTDOWN",
172 # "data": { "guest": true, "reason": "guest-shutdown" },
173 # "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
175 { 'event': 'SHUTDOWN', 'data': { 'guest': 'bool', 'reason': 'ShutdownCause' } }
180 # Emitted when the virtual machine is powered down through the power
181 # control system, such as via ACPI.
187 # <- { "event": "POWERDOWN",
188 # "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
190 { 'event': 'POWERDOWN' }
195 # Emitted when the virtual machine is reset
197 # @guest: If true, the reset was triggered by a guest request (such as
198 # a guest-initiated ACPI reboot request or other hardware-specific
199 # action) rather than a host request (such as the QMP command
200 # system_reset). (since 2.10)
202 # @reason: The @ShutdownCause of the RESET. (since 4.0)
208 # <- { "event": "RESET",
209 # "data": { "guest": false, "reason": "guest-reset" },
210 # "timestamp": { "seconds": 1267041653, "microseconds": 9518 } }
212 { 'event': 'RESET', 'data': { 'guest': 'bool', 'reason': 'ShutdownCause' } }
217 # Emitted when the virtual machine is stopped
223 # <- { "event": "STOP",
224 # "timestamp": { "seconds": 1267041730, "microseconds": 281295 } }
231 # Emitted when the virtual machine resumes execution
237 # <- { "event": "RESUME",
238 # "timestamp": { "seconds": 1271770767, "microseconds": 582542 } }
240 { 'event': 'RESUME' }
245 # Emitted when guest enters a hardware suspension state, for example,
246 # S3 state, which is sometimes called standby state
252 # <- { "event": "SUSPEND",
253 # "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
255 { 'event': 'SUSPEND' }
260 # Emitted when guest enters a hardware suspension state with data
261 # saved on disk, for example, S4 state, which is sometimes called
264 # Note: QEMU shuts down (similar to event @SHUTDOWN) when entering
271 # <- { "event": "SUSPEND_DISK",
272 # "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
274 { 'event': 'SUSPEND_DISK' }
279 # Emitted when the guest has woken up from suspend state and is
286 # <- { "event": "WAKEUP",
287 # "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
289 { 'event': 'WAKEUP' }
294 # Emitted when the watchdog device's timer is expired
296 # @action: action that has been taken
298 # Note: If action is "reset", "shutdown", or "pause" the WATCHDOG
299 # event is followed respectively by the RESET, SHUTDOWN, or STOP
302 # Note: This event is rate-limited.
308 # <- { "event": "WATCHDOG",
309 # "data": { "action": "reset" },
310 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
312 { 'event': 'WATCHDOG',
313 'data': { 'action': 'WatchdogAction' } }
318 # An enumeration of the actions taken when the watchdog device's timer
321 # @reset: system resets
323 # @shutdown: system shutdown, note that it is similar to @powerdown,
324 # which tries to set to system status and notify guest
326 # @poweroff: system poweroff, the emulator program exits
328 # @pause: system pauses, similar to @stop
330 # @debug: system enters debug state
332 # @none: nothing is done
334 # @inject-nmi: a non-maskable interrupt is injected into the first
335 # VCPU (all VCPUS on x86) (since 2.4)
339 { 'enum': 'WatchdogAction',
340 'data': [ 'reset', 'shutdown', 'poweroff', 'pause', 'debug', 'none',
346 # Possible QEMU actions upon guest reboot
348 # @reset: Reset the VM
350 # @shutdown: Shutdown the VM and exit, according to the shutdown
355 { 'enum': 'RebootAction',
356 'data': [ 'reset', 'shutdown' ] }
361 # Possible QEMU actions upon guest shutdown
363 # @poweroff: Shutdown the VM and exit
365 # @pause: pause the VM
369 { 'enum': 'ShutdownAction',
370 'data': [ 'poweroff', 'pause' ] }
375 # @none: Continue VM execution
377 # @pause: Pause the VM
379 # @shutdown: Shutdown the VM and exit, according to the shutdown
382 # @exit-failure: Shutdown the VM and exit with nonzero status (since
387 { 'enum': 'PanicAction',
388 'data': [ 'pause', 'shutdown', 'exit-failure', 'none' ] }
391 # @watchdog-set-action:
393 # Set watchdog action
397 { 'command': 'watchdog-set-action', 'data' : {'action': 'WatchdogAction'} }
402 # Set the actions that will be taken by the emulator in response to
405 # @reboot: @RebootAction action taken on guest reboot.
407 # @shutdown: @ShutdownAction action taken on guest shutdown.
409 # @panic: @PanicAction action taken on guest panic.
411 # @watchdog: @WatchdogAction action taken when watchdog timer expires
414 # Returns: Nothing on success.
420 # -> { "execute": "set-action",
421 # "arguments": { "reboot": "shutdown",
422 # "shutdown" : "pause",
424 # "watchdog": "inject-nmi" } }
425 # <- { "return": {} }
427 { 'command': 'set-action',
428 'data': { '*reboot': 'RebootAction',
429 '*shutdown': 'ShutdownAction',
430 '*panic': 'PanicAction',
431 '*watchdog': 'WatchdogAction' },
432 'allow-preconfig': true }
437 # Emitted when guest OS panic is detected
439 # @action: action that has been taken, currently always "pause"
441 # @info: information about a panic (since 2.9)
447 # <- { "event": "GUEST_PANICKED",
448 # "data": { "action": "pause" },
449 # "timestamp": { "seconds": 1648245231, "microseconds": 900001 } }
451 { 'event': 'GUEST_PANICKED',
452 'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } }
455 # @GUEST_CRASHLOADED:
457 # Emitted when guest OS crash loaded is detected
459 # @action: action that has been taken, currently always "run"
461 # @info: information about a panic
467 # <- { "event": "GUEST_CRASHLOADED",
468 # "data": { "action": "run" },
469 # "timestamp": { "seconds": 1648245259, "microseconds": 893771 } }
471 { 'event': 'GUEST_CRASHLOADED',
472 'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } }
477 # An enumeration of the actions taken when guest OS panic is detected
479 # @pause: system pauses
481 # @poweroff: system powers off (since 2.8)
483 # @run: system continues to run (since 5.0)
487 { 'enum': 'GuestPanicAction',
488 'data': [ 'pause', 'poweroff', 'run' ] }
491 # @GuestPanicInformationType:
493 # An enumeration of the guest panic information types
495 # @hyper-v: hyper-v guest panic information type
497 # @s390: s390 guest panic information type (Since: 2.12)
501 { 'enum': 'GuestPanicInformationType',
502 'data': [ 'hyper-v', 's390' ] }
505 # @GuestPanicInformation:
507 # Information about a guest panic
509 # @type: Crash type that defines the hypervisor specific information
513 {'union': 'GuestPanicInformation',
514 'base': {'type': 'GuestPanicInformationType'},
515 'discriminator': 'type',
516 'data': {'hyper-v': 'GuestPanicInformationHyperV',
517 's390': 'GuestPanicInformationS390'}}
520 # @GuestPanicInformationHyperV:
522 # Hyper-V specific guest panic information (HV crash MSRs)
526 {'struct': 'GuestPanicInformationHyperV',
527 'data': {'arg1': 'uint64',
536 # Reason why the CPU is in a crashed state.
538 # @unknown: no crash reason was set
540 # @disabled-wait: the CPU has entered a disabled wait state
542 # @extint-loop: clock comparator or cpu timer interrupt with new PSW
543 # enabled for external interrupts
545 # @pgmint-loop: program interrupt with BAD new PSW
547 # @opint-loop: operation exception interrupt with invalid code at the
548 # program interrupt new PSW
552 { 'enum': 'S390CrashReason',
560 # @GuestPanicInformationS390:
562 # S390 specific guest panic information (PSW)
564 # @core: core id of the CPU that crashed
566 # @psw-mask: control fields of guest PSW
568 # @psw-addr: guest instruction address
570 # @reason: guest crash reason
574 {'struct': 'GuestPanicInformationS390',
575 'data': {'core': 'uint32',
576 'psw-mask': 'uint64',
577 'psw-addr': 'uint64',
578 'reason': 'S390CrashReason'}}
583 # Emitted when a memory failure occurs on host side.
585 # @recipient: recipient is defined as @MemoryFailureRecipient.
587 # @action: action that has been taken. action is defined as
588 # @MemoryFailureAction.
590 # @flags: flags for MemoryFailureAction. action is defined as
591 # @MemoryFailureFlags.
597 # <- { "event": "MEMORY_FAILURE",
598 # "data": { "recipient": "hypervisor",
600 # "flags": { "action-required": false,
601 # "recursive": false } },
602 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
604 { 'event': 'MEMORY_FAILURE',
605 'data': { 'recipient': 'MemoryFailureRecipient',
606 'action': 'MemoryFailureAction',
607 'flags': 'MemoryFailureFlags'} }
610 # @MemoryFailureRecipient:
612 # Hardware memory failure occurs, handled by recipient.
614 # @hypervisor: memory failure at QEMU process address space. (none
615 # guest memory, but used by QEMU itself).
617 # @guest: memory failure at guest memory,
621 { 'enum': 'MemoryFailureRecipient',
622 'data': [ 'hypervisor',
626 # @MemoryFailureAction:
628 # Actions taken by QEMU in response to a hardware memory failure.
630 # @ignore: the memory failure could be ignored. This will only be the
631 # case for action-optional failures.
633 # @inject: memory failure occurred in guest memory, the guest enabled
634 # MCE handling mechanism, and QEMU could inject the MCE into the
635 # guest successfully.
637 # @fatal: the failure is unrecoverable. This occurs for
638 # action-required failures if the recipient is the hypervisor;
641 # @reset: the failure is unrecoverable but confined to the guest.
642 # This occurs if the recipient is a guest guest which is not ready
643 # to handle memory failures.
647 { 'enum': 'MemoryFailureAction',
654 # @MemoryFailureFlags:
656 # Additional information on memory failures.
658 # @action-required: whether a memory failure event is action-required
659 # or action-optional (e.g. a failure during memory scrub).
661 # @recursive: whether the failure occurred while the previous failure
662 # was still in progress.
666 { 'struct': 'MemoryFailureFlags',
667 'data': { 'action-required': 'bool',
668 'recursive': 'bool'} }
671 # @NotifyVmexitOption:
673 # An enumeration of the options specified when enabling notify VM exit
675 # @run: enable the feature, do nothing and continue if the notify VM
678 # @internal-error: enable the feature, raise a internal error if the
679 # notify VM exit happens.
681 # @disable: disable the feature.
685 { 'enum': 'NotifyVmexitOption',
686 'data': [ 'run', 'internal-error', 'disable' ] }