# @colo: guest is paused to save/restore VM state under colo checkpoint,
# VM can not get into this state unless colo capability is enabled
# for migration. (since 2.8)
+# @preconfig: QEMU is paused before board specific init callback is executed.
+# The state is reachable only if the --preconfig CLI option is used.
+# (Since 3.0)
##
{ 'enum': 'RunState',
'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused',
'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm',
'running', 'save-vm', 'shutdown', 'suspended', 'watchdog',
- 'guest-panicked', 'colo' ] }
+ 'guest-panicked', 'colo', 'preconfig' ] }
+
+##
+# @ShutdownCause:
+#
+# An enumeration of reasons for a Shutdown.
+#
+# @none: No shutdown request pending
+#
+# @host-error: An error prevents further use of guest
+#
+# @host-qmp-quit: Reaction to the QMP command 'quit'
+#
+# @host-qmp-system-reset: Reaction to the QMP command 'system_reset'
+#
+# @host-signal: Reaction to a signal, such as SIGINT
+#
+# @host-ui: Reaction to a UI event, like window close
+#
+# @guest-shutdown: Guest shutdown/suspend request, via ACPI or other
+# hardware-specific means
+#
+# @guest-reset: Guest reset request, and command line turns that into
+# a shutdown
+#
+# @guest-panic: Guest panicked, and command line turns that into a shutdown
+#
+# @subsystem-reset: Partial guest reset that does not trigger QMP events and
+# ignores --no-reboot. This is useful for sanitizing
+# hypercalls on s390 that are used during kexec/kdump/boot
+#
+##
+{ 'enum': 'ShutdownCause',
+ # Beware, shutdown_caused_by_guest() depends on enumeration order
+ 'data': [ 'none', 'host-error', 'host-qmp-quit', 'host-qmp-system-reset',
+ 'host-signal', 'host-ui', 'guest-shutdown', 'guest-reset',
+ 'guest-panic', 'subsystem-reset'] }
##
# @StatusInfo:
# "status": "running" } }
#
##
-{ 'command': 'query-status', 'returns': 'StatusInfo' }
+{ 'command': 'query-status', 'returns': 'StatusInfo',
+ 'allow-preconfig': true }
##
# @SHUTDOWN:
# a guest-initiated ACPI shutdown request or other hardware-specific action)
# rather than a host request (such as sending qemu a SIGINT). (since 2.10)
#
+# @reason: The @ShutdownCause which resulted in the SHUTDOWN. (since 4.0)
+#
# Note: If the command-line option "-no-shutdown" has been specified, qemu will
# not exit, and a STOP event will eventually follow the SHUTDOWN event
#
# "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
#
##
-{ 'event': 'SHUTDOWN', 'data': { 'guest': 'bool' } }
+{ 'event': 'SHUTDOWN', 'data': { 'guest': 'bool', 'reason': 'ShutdownCause' } }
##
# @POWERDOWN:
# rather than a host request (such as the QMP command system_reset).
# (since 2.10)
#
+# @reason: The @ShutdownCause of the RESET. (since 4.0)
+#
# Since: 0.12.0
#
# Example:
# "timestamp": { "seconds": 1267041653, "microseconds": 9518 } }
#
##
-{ 'event': 'RESET', 'data': { 'guest': 'bool' } }
+{ 'event': 'RESET', 'data': { 'guest': 'bool', 'reason': 'ShutdownCause' } }
##
# @STOP:
#
##
{ 'event': 'WATCHDOG',
- 'data': { 'action': 'WatchdogExpirationAction' } }
+ 'data': { 'action': 'WatchdogAction' } }
##
-# @WatchdogExpirationAction:
+# @WatchdogAction:
#
# An enumeration of the actions taken when the watchdog device's timer is
# expired
#
# Since: 2.1
##
-{ 'enum': 'WatchdogExpirationAction',
+{ 'enum': 'WatchdogAction',
'data': [ 'reset', 'shutdown', 'poweroff', 'pause', 'debug', 'none',
'inject-nmi' ] }
+##
+# @watchdog-set-action:
+#
+# Set watchdog action
+#
+# Since: 2.11
+##
+{ 'command': 'watchdog-set-action', 'data' : {'action': 'WatchdogAction'} }
+
##
# @GUEST_PANICKED:
#
#
# An enumeration of the guest panic information types
#
+# @hyper-v: hyper-v guest panic information type
+#
+# @s390: s390 guest panic information type (Since: 2.12)
+#
# Since: 2.9
##
{ 'enum': 'GuestPanicInformationType',
- 'data': [ 'hyper-v'] }
+ 'data': [ 'hyper-v', 's390' ] }
##
# @GuestPanicInformation:
#
# Information about a guest panic
#
+# @type: Crash type that defines the hypervisor specific information
+#
# Since: 2.9
##
{'union': 'GuestPanicInformation',
'base': {'type': 'GuestPanicInformationType'},
'discriminator': 'type',
- 'data': { 'hyper-v': 'GuestPanicInformationHyperV' } }
+ 'data': { 'hyper-v': 'GuestPanicInformationHyperV',
+ 's390': 'GuestPanicInformationS390' } }
##
# @GuestPanicInformationHyperV:
'arg3': 'uint64',
'arg4': 'uint64',
'arg5': 'uint64' } }
+
+##
+# @S390CrashReason:
+#
+# Reason why the CPU is in a crashed state.
+#
+# @unknown: no crash reason was set
+#
+# @disabled-wait: the CPU has entered a disabled wait state
+#
+# @extint-loop: clock comparator or cpu timer interrupt with new PSW enabled
+# for external interrupts
+#
+# @pgmint-loop: program interrupt with BAD new PSW
+#
+# @opint-loop: operation exception interrupt with invalid code at the program
+# interrupt new PSW
+#
+# Since: 2.12
+##
+{ 'enum': 'S390CrashReason',
+ 'data': [ 'unknown',
+ 'disabled-wait',
+ 'extint-loop',
+ 'pgmint-loop',
+ 'opint-loop' ] }
+
+##
+# @GuestPanicInformationS390:
+#
+# S390 specific guest panic information (PSW)
+#
+# @core: core id of the CPU that crashed
+# @psw-mask: control fields of guest PSW
+# @psw-addr: guest instruction address
+# @reason: guest crash reason
+#
+# Since: 2.12
+##
+{'struct': 'GuestPanicInformationS390',
+ 'data': { 'core': 'uint32',
+ 'psw-mask': 'uint64',
+ 'psw-addr': 'uint64',
+ 'reason': 'S390CrashReason' } }