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)
53 # @preconfig: QEMU is paused before board specific init callback is executed.
54 # The state is reachable only if the --preconfig CLI option is used.
58 'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused',
59 'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm',
60 'running', 'save-vm', 'shutdown', 'suspended', 'watchdog',
61 'guest-panicked', 'colo', 'preconfig' ] }
66 # An enumeration of reasons for a Shutdown.
68 # @none: No shutdown request pending
70 # @host-error: An error prevents further use of guest
72 # @host-qmp-quit: Reaction to the QMP command 'quit'
74 # @host-qmp-system-reset: Reaction to the QMP command 'system_reset'
76 # @host-signal: Reaction to a signal, such as SIGINT
78 # @host-ui: Reaction to a UI event, like window close
80 # @guest-shutdown: Guest shutdown/suspend request, via ACPI or other
81 # hardware-specific means
83 # @guest-reset: Guest reset request, and command line turns that into
86 # @guest-panic: Guest panicked, and command line turns that into a shutdown
88 # @subsystem-reset: Partial guest reset that does not trigger QMP events and
89 # ignores --no-reboot. This is useful for sanitizing
90 # hypercalls on s390 that are used during kexec/kdump/boot
93 { 'enum': 'ShutdownCause',
94 # Beware, shutdown_caused_by_guest() depends on enumeration order
95 'data': [ 'none', 'host-error', 'host-qmp-quit', 'host-qmp-system-reset',
96 'host-signal', 'host-ui', 'guest-shutdown', 'guest-reset',
97 'guest-panic', 'subsystem-reset'] }
102 # Information about VCPU run state
104 # @running: true if all VCPUs are runnable, false if not runnable
106 # @singlestep: true if VCPUs are in single-step mode
108 # @status: the virtual machine @RunState
112 # Notes: @singlestep is enabled through the GDB stub
114 { 'struct': 'StatusInfo',
115 'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
120 # Query the run status of all VCPUs
122 # Returns: @StatusInfo reflecting all VCPUs
128 # -> { "execute": "query-status" }
129 # <- { "return": { "running": true,
130 # "singlestep": false,
131 # "status": "running" } }
134 { 'command': 'query-status', 'returns': 'StatusInfo',
135 'allow-preconfig': true }
140 # Emitted when the virtual machine has shut down, indicating that qemu is
143 # @guest: If true, the shutdown was triggered by a guest request (such as
144 # a guest-initiated ACPI shutdown request or other hardware-specific action)
145 # rather than a host request (such as sending qemu a SIGINT). (since 2.10)
147 # @reason: The @ShutdownCause which resulted in the SHUTDOWN. (since 4.0)
149 # Note: If the command-line option "-no-shutdown" has been specified, qemu will
150 # not exit, and a STOP event will eventually follow the SHUTDOWN event
156 # <- { "event": "SHUTDOWN", "data": { "guest": true },
157 # "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
160 { 'event': 'SHUTDOWN', 'data': { 'guest': 'bool', 'reason': 'ShutdownCause' } }
165 # Emitted when the virtual machine is powered down through the power control
166 # system, such as via ACPI.
172 # <- { "event": "POWERDOWN",
173 # "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
176 { 'event': 'POWERDOWN' }
181 # Emitted when the virtual machine is reset
183 # @guest: If true, the reset was triggered by a guest request (such as
184 # a guest-initiated ACPI reboot request or other hardware-specific action)
185 # rather than a host request (such as the QMP command system_reset).
188 # @reason: The @ShutdownCause of the RESET. (since 4.0)
194 # <- { "event": "RESET", "data": { "guest": false },
195 # "timestamp": { "seconds": 1267041653, "microseconds": 9518 } }
198 { 'event': 'RESET', 'data': { 'guest': 'bool', 'reason': 'ShutdownCause' } }
203 # Emitted when the virtual machine is stopped
209 # <- { "event": "STOP",
210 # "timestamp": { "seconds": 1267041730, "microseconds": 281295 } }
218 # Emitted when the virtual machine resumes execution
224 # <- { "event": "RESUME",
225 # "timestamp": { "seconds": 1271770767, "microseconds": 582542 } }
228 { 'event': 'RESUME' }
233 # Emitted when guest enters a hardware suspension state, for example, S3 state,
234 # which is sometimes called standby state
240 # <- { "event": "SUSPEND",
241 # "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
244 { 'event': 'SUSPEND' }
249 # Emitted when guest enters a hardware suspension state with data saved on
250 # disk, for example, S4 state, which is sometimes called hibernate state
252 # Note: QEMU shuts down (similar to event @SHUTDOWN) when entering this state
258 # <- { "event": "SUSPEND_DISK",
259 # "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
262 { 'event': 'SUSPEND_DISK' }
267 # Emitted when the guest has woken up from suspend state and is running
273 # <- { "event": "WAKEUP",
274 # "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
277 { 'event': 'WAKEUP' }
282 # Emitted when the watchdog device's timer is expired
284 # @action: action that has been taken
286 # Note: If action is "reset", "shutdown", or "pause" the WATCHDOG event is
287 # followed respectively by the RESET, SHUTDOWN, or STOP events
289 # Note: This event is rate-limited.
295 # <- { "event": "WATCHDOG",
296 # "data": { "action": "reset" },
297 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
300 { 'event': 'WATCHDOG',
301 'data': { 'action': 'WatchdogAction' } }
306 # An enumeration of the actions taken when the watchdog device's timer is
309 # @reset: system resets
311 # @shutdown: system shutdown, note that it is similar to @powerdown, which
312 # tries to set to system status and notify guest
314 # @poweroff: system poweroff, the emulator program exits
316 # @pause: system pauses, similar to @stop
318 # @debug: system enters debug state
320 # @none: nothing is done
322 # @inject-nmi: a non-maskable interrupt is injected into the first VCPU (all
323 # VCPUS on x86) (since 2.4)
327 { 'enum': 'WatchdogAction',
328 'data': [ 'reset', 'shutdown', 'poweroff', 'pause', 'debug', 'none',
332 # @watchdog-set-action:
334 # Set watchdog action
338 { 'command': 'watchdog-set-action', 'data' : {'action': 'WatchdogAction'} }
343 # Emitted when guest OS panic is detected
345 # @action: action that has been taken, currently always "pause"
347 # @info: information about a panic (since 2.9)
353 # <- { "event": "GUEST_PANICKED",
354 # "data": { "action": "pause" } }
357 { 'event': 'GUEST_PANICKED',
358 'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } }
361 # @GUEST_CRASHLOADED:
363 # Emitted when guest OS crash loaded is detected
365 # @action: action that has been taken, currently always "run"
367 # @info: information about a panic
373 # <- { "event": "GUEST_CRASHLOADED",
374 # "data": { "action": "run" } }
377 { 'event': 'GUEST_CRASHLOADED',
378 'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } }
383 # An enumeration of the actions taken when guest OS panic is detected
385 # @pause: system pauses
387 # Since: 2.1 (poweroff since 2.8, run since 5.0)
389 { 'enum': 'GuestPanicAction',
390 'data': [ 'pause', 'poweroff', 'run' ] }
393 # @GuestPanicInformationType:
395 # An enumeration of the guest panic information types
397 # @hyper-v: hyper-v guest panic information type
399 # @s390: s390 guest panic information type (Since: 2.12)
403 { 'enum': 'GuestPanicInformationType',
404 'data': [ 'hyper-v', 's390' ] }
407 # @GuestPanicInformation:
409 # Information about a guest panic
411 # @type: Crash type that defines the hypervisor specific information
415 {'union': 'GuestPanicInformation',
416 'base': {'type': 'GuestPanicInformationType'},
417 'discriminator': 'type',
418 'data': { 'hyper-v': 'GuestPanicInformationHyperV',
419 's390': 'GuestPanicInformationS390' } }
422 # @GuestPanicInformationHyperV:
424 # Hyper-V specific guest panic information (HV crash MSRs)
428 {'struct': 'GuestPanicInformationHyperV',
429 'data': { 'arg1': 'uint64',
438 # Reason why the CPU is in a crashed state.
440 # @unknown: no crash reason was set
442 # @disabled-wait: the CPU has entered a disabled wait state
444 # @extint-loop: clock comparator or cpu timer interrupt with new PSW enabled
445 # for external interrupts
447 # @pgmint-loop: program interrupt with BAD new PSW
449 # @opint-loop: operation exception interrupt with invalid code at the program
454 { 'enum': 'S390CrashReason',
462 # @GuestPanicInformationS390:
464 # S390 specific guest panic information (PSW)
466 # @core: core id of the CPU that crashed
467 # @psw-mask: control fields of guest PSW
468 # @psw-addr: guest instruction address
469 # @reason: guest crash reason
473 {'struct': 'GuestPanicInformationS390',
474 'data': { 'core': 'uint32',
475 'psw-mask': 'uint64',
476 'psw-addr': 'uint64',
477 'reason': 'S390CrashReason' } }