blob: 332e44897b718eed2368e0c63f88a252b06c0e5a [file] [log] [blame]
Markus Armbruster0e201d32017-08-24 21:13:57 +02001# -*- Mode: Python -*-
2#
3
4##
5# = VM run state
6##
7
8##
9# @RunState:
10#
11# An enumeration of VM run states.
12#
13# @debug: QEMU is running on a debugger
14#
15# @finish-migrate: guest is paused to finish the migration process
16#
17# @inmigrate: guest is paused waiting for an incoming migration. Note
18# that this state does not tell whether the machine will start at the
19# end of the migration. This depends on the command-line -S option and
20# any invocation of 'stop' or 'cont' that has happened since QEMU was
21# started.
22#
23# @internal-error: An internal error that prevents further guest execution
24# has occurred
25#
26# @io-error: the last IOP has failed and the device is configured to pause
27# on I/O errors
28#
29# @paused: guest has been paused via the 'stop' command
30#
31# @postmigrate: guest is paused following a successful 'migrate'
32#
33# @prelaunch: QEMU was started with -S and guest has not started
34#
35# @restore-vm: guest is paused to restore VM state
36#
37# @running: guest is actively running
38#
39# @save-vm: guest is paused to save the VM state
40#
41# @shutdown: guest is shut down (and -no-shutdown is in use)
42#
43# @suspended: guest is suspended (ACPI S3)
44#
45# @watchdog: the watchdog action is configured to pause and has been triggered
46#
47# @guest-panicked: guest has been panicked as a result of guest OS panic
48#
49# @colo: guest is paused to save/restore VM state under colo checkpoint,
50# VM can not get into this state unless colo capability is enabled
51# for migration. (since 2.8)
Igor Mammedov8a362832018-05-04 10:37:41 +020052# @preconfig: QEMU is paused before board specific init callback is executed.
53# The state is reachable only if the --preconfig CLI option is used.
54# (Since 3.0)
Markus Armbruster0e201d32017-08-24 21:13:57 +020055##
56{ 'enum': 'RunState',
57 'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused',
58 'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm',
59 'running', 'save-vm', 'shutdown', 'suspended', 'watchdog',
Igor Mammedov8a362832018-05-04 10:37:41 +020060 'guest-panicked', 'colo', 'preconfig' ] }
Markus Armbruster0e201d32017-08-24 21:13:57 +020061
62##
63# @StatusInfo:
64#
65# Information about VCPU run state
66#
67# @running: true if all VCPUs are runnable, false if not runnable
68#
69# @singlestep: true if VCPUs are in single-step mode
70#
71# @status: the virtual machine @RunState
72#
73# Since: 0.14.0
74#
75# Notes: @singlestep is enabled through the GDB stub
76##
77{ 'struct': 'StatusInfo',
78 'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
79
80##
81# @query-status:
82#
83# Query the run status of all VCPUs
84#
85# Returns: @StatusInfo reflecting all VCPUs
86#
87# Since: 0.14.0
88#
89# Example:
90#
91# -> { "execute": "query-status" }
92# <- { "return": { "running": true,
93# "singlestep": false,
94# "status": "running" } }
95#
96##
Igor Mammedovd6fe3d02018-05-11 18:51:43 +020097{ 'command': 'query-status', 'returns': 'StatusInfo',
98 'allow-preconfig': true }
Markus Armbruster0e201d32017-08-24 21:13:57 +020099
100##
101# @SHUTDOWN:
102#
103# Emitted when the virtual machine has shut down, indicating that qemu is
104# about to exit.
105#
106# @guest: If true, the shutdown was triggered by a guest request (such as
107# a guest-initiated ACPI shutdown request or other hardware-specific action)
108# rather than a host request (such as sending qemu a SIGINT). (since 2.10)
109#
110# Note: If the command-line option "-no-shutdown" has been specified, qemu will
111# not exit, and a STOP event will eventually follow the SHUTDOWN event
112#
113# Since: 0.12.0
114#
115# Example:
116#
117# <- { "event": "SHUTDOWN", "data": { "guest": true },
118# "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
119#
120##
121{ 'event': 'SHUTDOWN', 'data': { 'guest': 'bool' } }
122
123##
124# @POWERDOWN:
125#
126# Emitted when the virtual machine is powered down through the power control
127# system, such as via ACPI.
128#
129# Since: 0.12.0
130#
131# Example:
132#
133# <- { "event": "POWERDOWN",
134# "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
135#
136##
137{ 'event': 'POWERDOWN' }
138
139##
140# @RESET:
141#
142# Emitted when the virtual machine is reset
143#
144# @guest: If true, the reset was triggered by a guest request (such as
145# a guest-initiated ACPI reboot request or other hardware-specific action)
146# rather than a host request (such as the QMP command system_reset).
147# (since 2.10)
148#
149# Since: 0.12.0
150#
151# Example:
152#
153# <- { "event": "RESET", "data": { "guest": false },
154# "timestamp": { "seconds": 1267041653, "microseconds": 9518 } }
155#
156##
157{ 'event': 'RESET', 'data': { 'guest': 'bool' } }
158
159##
160# @STOP:
161#
162# Emitted when the virtual machine is stopped
163#
164# Since: 0.12.0
165#
166# Example:
167#
168# <- { "event": "STOP",
169# "timestamp": { "seconds": 1267041730, "microseconds": 281295 } }
170#
171##
172{ 'event': 'STOP' }
173
174##
175# @RESUME:
176#
177# Emitted when the virtual machine resumes execution
178#
179# Since: 0.12.0
180#
181# Example:
182#
183# <- { "event": "RESUME",
184# "timestamp": { "seconds": 1271770767, "microseconds": 582542 } }
185#
186##
187{ 'event': 'RESUME' }
188
189##
190# @SUSPEND:
191#
192# Emitted when guest enters a hardware suspension state, for example, S3 state,
193# which is sometimes called standby state
194#
195# Since: 1.1
196#
197# Example:
198#
199# <- { "event": "SUSPEND",
200# "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
201#
202##
203{ 'event': 'SUSPEND' }
204
205##
206# @SUSPEND_DISK:
207#
208# Emitted when guest enters a hardware suspension state with data saved on
209# disk, for example, S4 state, which is sometimes called hibernate state
210#
211# Note: QEMU shuts down (similar to event @SHUTDOWN) when entering this state
212#
213# Since: 1.2
214#
215# Example:
216#
217# <- { "event": "SUSPEND_DISK",
218# "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
219#
220##
221{ 'event': 'SUSPEND_DISK' }
222
223##
224# @WAKEUP:
225#
226# Emitted when the guest has woken up from suspend state and is running
227#
228# Since: 1.1
229#
230# Example:
231#
232# <- { "event": "WAKEUP",
233# "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
234#
235##
236{ 'event': 'WAKEUP' }
237
238##
239# @WATCHDOG:
240#
241# Emitted when the watchdog device's timer is expired
242#
243# @action: action that has been taken
244#
245# Note: If action is "reset", "shutdown", or "pause" the WATCHDOG event is
246# followed respectively by the RESET, SHUTDOWN, or STOP events
247#
248# Note: This event is rate-limited.
249#
250# Since: 0.13.0
251#
252# Example:
253#
254# <- { "event": "WATCHDOG",
255# "data": { "action": "reset" },
256# "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
257#
258##
259{ 'event': 'WATCHDOG',
Michal Privoznik14d53b42017-09-07 10:05:24 +0200260 'data': { 'action': 'WatchdogAction' } }
Markus Armbruster0e201d32017-08-24 21:13:57 +0200261
262##
Michal Privoznik14d53b42017-09-07 10:05:24 +0200263# @WatchdogAction:
Markus Armbruster0e201d32017-08-24 21:13:57 +0200264#
265# An enumeration of the actions taken when the watchdog device's timer is
266# expired
267#
268# @reset: system resets
269#
270# @shutdown: system shutdown, note that it is similar to @powerdown, which
271# tries to set to system status and notify guest
272#
273# @poweroff: system poweroff, the emulator program exits
274#
275# @pause: system pauses, similar to @stop
276#
277# @debug: system enters debug state
278#
279# @none: nothing is done
280#
281# @inject-nmi: a non-maskable interrupt is injected into the first VCPU (all
282# VCPUS on x86) (since 2.4)
283#
284# Since: 2.1
285##
Michal Privoznik14d53b42017-09-07 10:05:24 +0200286{ 'enum': 'WatchdogAction',
Markus Armbruster0e201d32017-08-24 21:13:57 +0200287 'data': [ 'reset', 'shutdown', 'poweroff', 'pause', 'debug', 'none',
288 'inject-nmi' ] }
289
290##
Eric Blake3da7a412018-02-26 16:57:43 -0600291# @watchdog-set-action:
292#
293# Set watchdog action
294#
295# Since: 2.11
296##
297{ 'command': 'watchdog-set-action', 'data' : {'action': 'WatchdogAction'} }
298
299##
Markus Armbruster0e201d32017-08-24 21:13:57 +0200300# @GUEST_PANICKED:
301#
302# Emitted when guest OS panic is detected
303#
304# @action: action that has been taken, currently always "pause"
305#
306# @info: information about a panic (since 2.9)
307#
308# Since: 1.5
309#
310# Example:
311#
312# <- { "event": "GUEST_PANICKED",
313# "data": { "action": "pause" } }
314#
315##
316{ 'event': 'GUEST_PANICKED',
317 'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } }
318
319##
320# @GuestPanicAction:
321#
322# An enumeration of the actions taken when guest OS panic is detected
323#
324# @pause: system pauses
325#
326# Since: 2.1 (poweroff since 2.8)
327##
328{ 'enum': 'GuestPanicAction',
329 'data': [ 'pause', 'poweroff' ] }
330
331##
332# @GuestPanicInformationType:
333#
334# An enumeration of the guest panic information types
335#
Christian Borntraeger4ada99a2018-02-09 12:25:43 +0000336# @hyper-v: hyper-v guest panic information type
337#
338# @s390: s390 guest panic information type (Since: 2.12)
339#
Markus Armbruster0e201d32017-08-24 21:13:57 +0200340# Since: 2.9
341##
342{ 'enum': 'GuestPanicInformationType',
Christian Borntraeger4ada99a2018-02-09 12:25:43 +0000343 'data': [ 'hyper-v', 's390' ] }
Markus Armbruster0e201d32017-08-24 21:13:57 +0200344
345##
346# @GuestPanicInformation:
347#
348# Information about a guest panic
349#
Christian Borntraeger4ada99a2018-02-09 12:25:43 +0000350# @type: Crash type that defines the hypervisor specific information
351#
Markus Armbruster0e201d32017-08-24 21:13:57 +0200352# Since: 2.9
353##
354{'union': 'GuestPanicInformation',
355 'base': {'type': 'GuestPanicInformationType'},
356 'discriminator': 'type',
Christian Borntraeger4ada99a2018-02-09 12:25:43 +0000357 'data': { 'hyper-v': 'GuestPanicInformationHyperV',
358 's390': 'GuestPanicInformationS390' } }
Markus Armbruster0e201d32017-08-24 21:13:57 +0200359
360##
361# @GuestPanicInformationHyperV:
362#
363# Hyper-V specific guest panic information (HV crash MSRs)
364#
365# Since: 2.9
366##
367{'struct': 'GuestPanicInformationHyperV',
368 'data': { 'arg1': 'uint64',
369 'arg2': 'uint64',
370 'arg3': 'uint64',
371 'arg4': 'uint64',
372 'arg5': 'uint64' } }
Christian Borntraeger4ada99a2018-02-09 12:25:43 +0000373
374##
375# @S390CrashReason:
376#
377# Reason why the CPU is in a crashed state.
378#
379# @unknown: no crash reason was set
380#
381# @disabled-wait: the CPU has entered a disabled wait state
382#
383# @extint-loop: clock comparator or cpu timer interrupt with new PSW enabled
384# for external interrupts
385#
386# @pgmint-loop: program interrupt with BAD new PSW
387#
388# @opint-loop: operation exception interrupt with invalid code at the program
389# interrupt new PSW
390#
391# Since: 2.12
392##
393{ 'enum': 'S390CrashReason',
394 'data': [ 'unknown',
395 'disabled-wait',
396 'extint-loop',
397 'pgmint-loop',
398 'opint-loop' ] }
399
400##
401# @GuestPanicInformationS390:
402#
403# S390 specific guest panic information (PSW)
404#
405# @core: core id of the CPU that crashed
406# @psw-mask: control fields of guest PSW
407# @psw-addr: guest instruction address
408# @reason: guest crash reason
409#
410# Since: 2.12
411##
412{'struct': 'GuestPanicInformationS390',
413 'data': { 'core': 'uint32',
414 'psw-mask': 'uint64',
415 'psw-addr': 'uint64',
416 'reason': 'S390CrashReason' } }