Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 1 | # -*- Mode: Python -*- |
Andrea Bolognani | f7160f3 | 2020-07-29 20:50:24 +0200 | [diff] [blame] | 2 | # vim: filetype=python |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 3 | # |
| 4 | |
| 5 | ## |
| 6 | # = VM run state |
| 7 | ## |
| 8 | |
| 9 | ## |
| 10 | # @RunState: |
| 11 | # |
| 12 | # An enumeration of VM run states. |
| 13 | # |
| 14 | # @debug: QEMU is running on a debugger |
| 15 | # |
| 16 | # @finish-migrate: guest is paused to finish the migration process |
| 17 | # |
| 18 | # @inmigrate: guest is paused waiting for an incoming migration. Note |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 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 |
| 22 | # started. |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 23 | # |
| 24 | # @internal-error: An internal error that prevents further guest execution |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 25 | # has occurred |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 26 | # |
| 27 | # @io-error: the last IOP has failed and the device is configured to pause |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 28 | # on I/O errors |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 29 | # |
| 30 | # @paused: guest has been paused via the 'stop' command |
| 31 | # |
| 32 | # @postmigrate: guest is paused following a successful 'migrate' |
| 33 | # |
| 34 | # @prelaunch: QEMU was started with -S and guest has not started |
| 35 | # |
| 36 | # @restore-vm: guest is paused to restore VM state |
| 37 | # |
| 38 | # @running: guest is actively running |
| 39 | # |
| 40 | # @save-vm: guest is paused to save the VM state |
| 41 | # |
| 42 | # @shutdown: guest is shut down (and -no-shutdown is in use) |
| 43 | # |
| 44 | # @suspended: guest is suspended (ACPI S3) |
| 45 | # |
| 46 | # @watchdog: the watchdog action is configured to pause and has been triggered |
| 47 | # |
| 48 | # @guest-panicked: guest has been panicked as a result of guest OS panic |
| 49 | # |
| 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 | ## |
| 54 | { 'enum': 'RunState', |
| 55 | 'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused', |
| 56 | 'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm', |
| 57 | 'running', 'save-vm', 'shutdown', 'suspended', 'watchdog', |
Paolo Bonzini | 164dafd | 2020-10-27 04:44:18 -0400 | [diff] [blame] | 58 | 'guest-panicked', 'colo' ] } |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 59 | |
| 60 | ## |
Dominik Csapak | d43013e | 2018-12-05 12:01:29 +0100 | [diff] [blame] | 61 | # @ShutdownCause: |
| 62 | # |
| 63 | # An enumeration of reasons for a Shutdown. |
| 64 | # |
| 65 | # @none: No shutdown request pending |
| 66 | # |
| 67 | # @host-error: An error prevents further use of guest |
| 68 | # |
Dominik Csapak | 9254893 | 2018-12-05 12:01:31 +0100 | [diff] [blame] | 69 | # @host-qmp-quit: Reaction to the QMP command 'quit' |
| 70 | # |
| 71 | # @host-qmp-system-reset: Reaction to the QMP command 'system_reset' |
Dominik Csapak | d43013e | 2018-12-05 12:01:29 +0100 | [diff] [blame] | 72 | # |
| 73 | # @host-signal: Reaction to a signal, such as SIGINT |
| 74 | # |
| 75 | # @host-ui: Reaction to a UI event, like window close |
| 76 | # |
| 77 | # @guest-shutdown: Guest shutdown/suspend request, via ACPI or other |
| 78 | # hardware-specific means |
| 79 | # |
| 80 | # @guest-reset: Guest reset request, and command line turns that into |
| 81 | # a shutdown |
| 82 | # |
| 83 | # @guest-panic: Guest panicked, and command line turns that into a shutdown |
| 84 | # |
| 85 | # @subsystem-reset: Partial guest reset that does not trigger QMP events and |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 86 | # ignores --no-reboot. This is useful for sanitizing |
| 87 | # hypercalls on s390 that are used during kexec/kdump/boot |
Dominik Csapak | d43013e | 2018-12-05 12:01:29 +0100 | [diff] [blame] | 88 | # |
Jason A. Donenfeld | 7966d70 | 2022-10-25 02:43:17 +0200 | [diff] [blame] | 89 | # @snapshot-load: A snapshot is being loaded by the record & replay |
| 90 | # subsystem. This value is used only within QEMU. It |
| 91 | # doesn't occur in QMP. (since 7.2) |
| 92 | # |
Dominik Csapak | d43013e | 2018-12-05 12:01:29 +0100 | [diff] [blame] | 93 | ## |
| 94 | { 'enum': 'ShutdownCause', |
| 95 | # Beware, shutdown_caused_by_guest() depends on enumeration order |
Dominik Csapak | 9254893 | 2018-12-05 12:01:31 +0100 | [diff] [blame] | 96 | 'data': [ 'none', 'host-error', 'host-qmp-quit', 'host-qmp-system-reset', |
| 97 | 'host-signal', 'host-ui', 'guest-shutdown', 'guest-reset', |
Jason A. Donenfeld | 7966d70 | 2022-10-25 02:43:17 +0200 | [diff] [blame] | 98 | 'guest-panic', 'subsystem-reset', 'snapshot-load'] } |
Dominik Csapak | d43013e | 2018-12-05 12:01:29 +0100 | [diff] [blame] | 99 | |
| 100 | ## |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 101 | # @StatusInfo: |
| 102 | # |
| 103 | # Information about VCPU run state |
| 104 | # |
| 105 | # @running: true if all VCPUs are runnable, false if not runnable |
| 106 | # |
| 107 | # @singlestep: true if VCPUs are in single-step mode |
| 108 | # |
| 109 | # @status: the virtual machine @RunState |
| 110 | # |
Andrea Bolognani | 23e4645 | 2022-05-03 09:37:35 +0200 | [diff] [blame] | 111 | # Since: 0.14 |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 112 | # |
| 113 | # Notes: @singlestep is enabled through the GDB stub |
| 114 | ## |
| 115 | { 'struct': 'StatusInfo', |
| 116 | 'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} } |
| 117 | |
| 118 | ## |
| 119 | # @query-status: |
| 120 | # |
| 121 | # Query the run status of all VCPUs |
| 122 | # |
| 123 | # Returns: @StatusInfo reflecting all VCPUs |
| 124 | # |
Andrea Bolognani | 23e4645 | 2022-05-03 09:37:35 +0200 | [diff] [blame] | 125 | # Since: 0.14 |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 126 | # |
| 127 | # Example: |
| 128 | # |
| 129 | # -> { "execute": "query-status" } |
| 130 | # <- { "return": { "running": true, |
| 131 | # "singlestep": false, |
| 132 | # "status": "running" } } |
| 133 | # |
| 134 | ## |
Igor Mammedov | d6fe3d0 | 2018-05-11 18:51:43 +0200 | [diff] [blame] | 135 | { 'command': 'query-status', 'returns': 'StatusInfo', |
| 136 | 'allow-preconfig': true } |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 137 | |
| 138 | ## |
| 139 | # @SHUTDOWN: |
| 140 | # |
| 141 | # Emitted when the virtual machine has shut down, indicating that qemu is |
| 142 | # about to exit. |
| 143 | # |
| 144 | # @guest: If true, the shutdown was triggered by a guest request (such as |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 145 | # a guest-initiated ACPI shutdown request or other hardware-specific action) |
| 146 | # rather than a host request (such as sending qemu a SIGINT). (since 2.10) |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 147 | # |
Dominik Csapak | ecd7a0d | 2018-12-05 12:01:30 +0100 | [diff] [blame] | 148 | # @reason: The @ShutdownCause which resulted in the SHUTDOWN. (since 4.0) |
| 149 | # |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 150 | # Note: If the command-line option "-no-shutdown" has been specified, qemu will |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 151 | # not exit, and a STOP event will eventually follow the SHUTDOWN event |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 152 | # |
Markus Armbruster | 9bc6e89 | 2020-11-18 07:41:58 +0100 | [diff] [blame] | 153 | # Since: 0.12 |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 154 | # |
| 155 | # Example: |
| 156 | # |
Victor Toso | d219119 | 2022-03-28 16:05:59 +0200 | [diff] [blame] | 157 | # <- { "event": "SHUTDOWN", |
| 158 | # "data": { "guest": true, "reason": "guest-shutdown" }, |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 159 | # "timestamp": { "seconds": 1267040730, "microseconds": 682951 } } |
| 160 | # |
| 161 | ## |
Dominik Csapak | ecd7a0d | 2018-12-05 12:01:30 +0100 | [diff] [blame] | 162 | { 'event': 'SHUTDOWN', 'data': { 'guest': 'bool', 'reason': 'ShutdownCause' } } |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 163 | |
| 164 | ## |
| 165 | # @POWERDOWN: |
| 166 | # |
| 167 | # Emitted when the virtual machine is powered down through the power control |
| 168 | # system, such as via ACPI. |
| 169 | # |
Markus Armbruster | 9bc6e89 | 2020-11-18 07:41:58 +0100 | [diff] [blame] | 170 | # Since: 0.12 |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 171 | # |
| 172 | # Example: |
| 173 | # |
| 174 | # <- { "event": "POWERDOWN", |
| 175 | # "timestamp": { "seconds": 1267040730, "microseconds": 682951 } } |
| 176 | # |
| 177 | ## |
| 178 | { 'event': 'POWERDOWN' } |
| 179 | |
| 180 | ## |
| 181 | # @RESET: |
| 182 | # |
| 183 | # Emitted when the virtual machine is reset |
| 184 | # |
| 185 | # @guest: If true, the reset was triggered by a guest request (such as |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 186 | # a guest-initiated ACPI reboot request or other hardware-specific action) |
| 187 | # rather than a host request (such as the QMP command system_reset). |
| 188 | # (since 2.10) |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 189 | # |
Dominik Csapak | ecd7a0d | 2018-12-05 12:01:30 +0100 | [diff] [blame] | 190 | # @reason: The @ShutdownCause of the RESET. (since 4.0) |
| 191 | # |
Markus Armbruster | 9bc6e89 | 2020-11-18 07:41:58 +0100 | [diff] [blame] | 192 | # Since: 0.12 |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 193 | # |
| 194 | # Example: |
| 195 | # |
Victor Toso | d219119 | 2022-03-28 16:05:59 +0200 | [diff] [blame] | 196 | # <- { "event": "RESET", |
| 197 | # "data": { "guest": false, "reason": "guest-reset" }, |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 198 | # "timestamp": { "seconds": 1267041653, "microseconds": 9518 } } |
| 199 | # |
| 200 | ## |
Dominik Csapak | ecd7a0d | 2018-12-05 12:01:30 +0100 | [diff] [blame] | 201 | { 'event': 'RESET', 'data': { 'guest': 'bool', 'reason': 'ShutdownCause' } } |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 202 | |
| 203 | ## |
| 204 | # @STOP: |
| 205 | # |
| 206 | # Emitted when the virtual machine is stopped |
| 207 | # |
Markus Armbruster | 9bc6e89 | 2020-11-18 07:41:58 +0100 | [diff] [blame] | 208 | # Since: 0.12 |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 209 | # |
| 210 | # Example: |
| 211 | # |
| 212 | # <- { "event": "STOP", |
| 213 | # "timestamp": { "seconds": 1267041730, "microseconds": 281295 } } |
| 214 | # |
| 215 | ## |
| 216 | { 'event': 'STOP' } |
| 217 | |
| 218 | ## |
| 219 | # @RESUME: |
| 220 | # |
| 221 | # Emitted when the virtual machine resumes execution |
| 222 | # |
Markus Armbruster | 9bc6e89 | 2020-11-18 07:41:58 +0100 | [diff] [blame] | 223 | # Since: 0.12 |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 224 | # |
| 225 | # Example: |
| 226 | # |
| 227 | # <- { "event": "RESUME", |
| 228 | # "timestamp": { "seconds": 1271770767, "microseconds": 582542 } } |
| 229 | # |
| 230 | ## |
| 231 | { 'event': 'RESUME' } |
| 232 | |
| 233 | ## |
| 234 | # @SUSPEND: |
| 235 | # |
| 236 | # Emitted when guest enters a hardware suspension state, for example, S3 state, |
| 237 | # which is sometimes called standby state |
| 238 | # |
| 239 | # Since: 1.1 |
| 240 | # |
| 241 | # Example: |
| 242 | # |
| 243 | # <- { "event": "SUSPEND", |
| 244 | # "timestamp": { "seconds": 1344456160, "microseconds": 309119 } } |
| 245 | # |
| 246 | ## |
| 247 | { 'event': 'SUSPEND' } |
| 248 | |
| 249 | ## |
| 250 | # @SUSPEND_DISK: |
| 251 | # |
| 252 | # Emitted when guest enters a hardware suspension state with data saved on |
| 253 | # disk, for example, S4 state, which is sometimes called hibernate state |
| 254 | # |
| 255 | # Note: QEMU shuts down (similar to event @SHUTDOWN) when entering this state |
| 256 | # |
| 257 | # Since: 1.2 |
| 258 | # |
| 259 | # Example: |
| 260 | # |
| 261 | # <- { "event": "SUSPEND_DISK", |
| 262 | # "timestamp": { "seconds": 1344456160, "microseconds": 309119 } } |
| 263 | # |
| 264 | ## |
| 265 | { 'event': 'SUSPEND_DISK' } |
| 266 | |
| 267 | ## |
| 268 | # @WAKEUP: |
| 269 | # |
| 270 | # Emitted when the guest has woken up from suspend state and is running |
| 271 | # |
| 272 | # Since: 1.1 |
| 273 | # |
| 274 | # Example: |
| 275 | # |
| 276 | # <- { "event": "WAKEUP", |
| 277 | # "timestamp": { "seconds": 1344522075, "microseconds": 745528 } } |
| 278 | # |
| 279 | ## |
| 280 | { 'event': 'WAKEUP' } |
| 281 | |
| 282 | ## |
| 283 | # @WATCHDOG: |
| 284 | # |
| 285 | # Emitted when the watchdog device's timer is expired |
| 286 | # |
| 287 | # @action: action that has been taken |
| 288 | # |
| 289 | # Note: If action is "reset", "shutdown", or "pause" the WATCHDOG event is |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 290 | # followed respectively by the RESET, SHUTDOWN, or STOP events |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 291 | # |
| 292 | # Note: This event is rate-limited. |
| 293 | # |
Markus Armbruster | 9bc6e89 | 2020-11-18 07:41:58 +0100 | [diff] [blame] | 294 | # Since: 0.13 |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 295 | # |
| 296 | # Example: |
| 297 | # |
| 298 | # <- { "event": "WATCHDOG", |
| 299 | # "data": { "action": "reset" }, |
| 300 | # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } } |
| 301 | # |
| 302 | ## |
| 303 | { 'event': 'WATCHDOG', |
Michal Privoznik | 14d53b4 | 2017-09-07 10:05:24 +0200 | [diff] [blame] | 304 | 'data': { 'action': 'WatchdogAction' } } |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 305 | |
| 306 | ## |
Michal Privoznik | 14d53b4 | 2017-09-07 10:05:24 +0200 | [diff] [blame] | 307 | # @WatchdogAction: |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 308 | # |
| 309 | # An enumeration of the actions taken when the watchdog device's timer is |
| 310 | # expired |
| 311 | # |
| 312 | # @reset: system resets |
| 313 | # |
| 314 | # @shutdown: system shutdown, note that it is similar to @powerdown, which |
| 315 | # tries to set to system status and notify guest |
| 316 | # |
| 317 | # @poweroff: system poweroff, the emulator program exits |
| 318 | # |
| 319 | # @pause: system pauses, similar to @stop |
| 320 | # |
| 321 | # @debug: system enters debug state |
| 322 | # |
| 323 | # @none: nothing is done |
| 324 | # |
| 325 | # @inject-nmi: a non-maskable interrupt is injected into the first VCPU (all |
| 326 | # VCPUS on x86) (since 2.4) |
| 327 | # |
| 328 | # Since: 2.1 |
| 329 | ## |
Michal Privoznik | 14d53b4 | 2017-09-07 10:05:24 +0200 | [diff] [blame] | 330 | { 'enum': 'WatchdogAction', |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 331 | 'data': [ 'reset', 'shutdown', 'poweroff', 'pause', 'debug', 'none', |
| 332 | 'inject-nmi' ] } |
| 333 | |
| 334 | ## |
Alejandro Jimenez | e6dba04 | 2020-12-11 11:52:43 -0500 | [diff] [blame] | 335 | # @RebootAction: |
| 336 | # |
| 337 | # Possible QEMU actions upon guest reboot |
| 338 | # |
Paolo Bonzini | c27025e | 2021-01-20 14:30:27 +0100 | [diff] [blame] | 339 | # @reset: Reset the VM |
Alejandro Jimenez | e6dba04 | 2020-12-11 11:52:43 -0500 | [diff] [blame] | 340 | # |
Paolo Bonzini | c27025e | 2021-01-20 14:30:27 +0100 | [diff] [blame] | 341 | # @shutdown: Shutdown the VM and exit, according to the shutdown action |
Alejandro Jimenez | e6dba04 | 2020-12-11 11:52:43 -0500 | [diff] [blame] | 342 | # |
| 343 | # Since: 6.0 |
| 344 | ## |
| 345 | { 'enum': 'RebootAction', |
Paolo Bonzini | c27025e | 2021-01-20 14:30:27 +0100 | [diff] [blame] | 346 | 'data': [ 'reset', 'shutdown' ] } |
Alejandro Jimenez | e6dba04 | 2020-12-11 11:52:43 -0500 | [diff] [blame] | 347 | |
| 348 | ## |
| 349 | # @ShutdownAction: |
| 350 | # |
| 351 | # Possible QEMU actions upon guest shutdown |
| 352 | # |
| 353 | # @poweroff: Shutdown the VM and exit |
| 354 | # |
Andrea Bolognani | f39057d | 2022-05-03 09:37:30 +0200 | [diff] [blame] | 355 | # @pause: pause the VM |
Alejandro Jimenez | e6dba04 | 2020-12-11 11:52:43 -0500 | [diff] [blame] | 356 | # |
| 357 | # Since: 6.0 |
| 358 | ## |
| 359 | { 'enum': 'ShutdownAction', |
| 360 | 'data': [ 'poweroff', 'pause' ] } |
| 361 | |
| 362 | ## |
Alejandro Jimenez | c753e8e | 2020-12-11 17:31:52 -0500 | [diff] [blame] | 363 | # @PanicAction: |
| 364 | # |
| 365 | # @none: Continue VM execution |
| 366 | # |
| 367 | # @pause: Pause the VM |
| 368 | # |
Paolo Bonzini | c27025e | 2021-01-20 14:30:27 +0100 | [diff] [blame] | 369 | # @shutdown: Shutdown the VM and exit, according to the shutdown action |
| 370 | # |
Ilya Leoshkevich | 0882caf | 2022-07-26 00:37:45 +0200 | [diff] [blame] | 371 | # @exit-failure: Shutdown the VM and exit with nonzero status |
| 372 | # (since 7.1) |
| 373 | # |
Alejandro Jimenez | c753e8e | 2020-12-11 17:31:52 -0500 | [diff] [blame] | 374 | # Since: 6.0 |
| 375 | ## |
| 376 | { 'enum': 'PanicAction', |
Ilya Leoshkevich | 0882caf | 2022-07-26 00:37:45 +0200 | [diff] [blame] | 377 | 'data': [ 'pause', 'shutdown', 'exit-failure', 'none' ] } |
Alejandro Jimenez | c753e8e | 2020-12-11 17:31:52 -0500 | [diff] [blame] | 378 | |
| 379 | ## |
Eric Blake | 3da7a41 | 2018-02-26 16:57:43 -0600 | [diff] [blame] | 380 | # @watchdog-set-action: |
| 381 | # |
| 382 | # Set watchdog action |
| 383 | # |
| 384 | # Since: 2.11 |
| 385 | ## |
| 386 | { 'command': 'watchdog-set-action', 'data' : {'action': 'WatchdogAction'} } |
| 387 | |
| 388 | ## |
Alejandro Jimenez | e6dba04 | 2020-12-11 11:52:43 -0500 | [diff] [blame] | 389 | # @set-action: |
| 390 | # |
| 391 | # Set the actions that will be taken by the emulator in response to guest |
| 392 | # events. |
| 393 | # |
| 394 | # @reboot: @RebootAction action taken on guest reboot. |
| 395 | # |
| 396 | # @shutdown: @ShutdownAction action taken on guest shutdown. |
| 397 | # |
Alejandro Jimenez | c753e8e | 2020-12-11 17:31:52 -0500 | [diff] [blame] | 398 | # @panic: @PanicAction action taken on guest panic. |
| 399 | # |
Alejandro Jimenez | e6dba04 | 2020-12-11 11:52:43 -0500 | [diff] [blame] | 400 | # @watchdog: @WatchdogAction action taken when watchdog timer expires . |
| 401 | # |
| 402 | # Returns: Nothing on success. |
| 403 | # |
| 404 | # Since: 6.0 |
| 405 | # |
| 406 | # Example: |
| 407 | # |
| 408 | # -> { "execute": "set-action", |
| 409 | # "arguments": { "reboot": "shutdown", |
| 410 | # "shutdown" : "pause", |
Alejandro Jimenez | c753e8e | 2020-12-11 17:31:52 -0500 | [diff] [blame] | 411 | # "panic": "pause", |
Alejandro Jimenez | e6dba04 | 2020-12-11 11:52:43 -0500 | [diff] [blame] | 412 | # "watchdog": "inject-nmi" } } |
| 413 | # <- { "return": {} } |
| 414 | ## |
| 415 | { 'command': 'set-action', |
| 416 | 'data': { '*reboot': 'RebootAction', |
| 417 | '*shutdown': 'ShutdownAction', |
Alejandro Jimenez | c753e8e | 2020-12-11 17:31:52 -0500 | [diff] [blame] | 418 | '*panic': 'PanicAction', |
Alejandro Jimenez | e6dba04 | 2020-12-11 11:52:43 -0500 | [diff] [blame] | 419 | '*watchdog': 'WatchdogAction' }, |
| 420 | 'allow-preconfig': true } |
| 421 | |
| 422 | ## |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 423 | # @GUEST_PANICKED: |
| 424 | # |
| 425 | # Emitted when guest OS panic is detected |
| 426 | # |
| 427 | # @action: action that has been taken, currently always "pause" |
| 428 | # |
| 429 | # @info: information about a panic (since 2.9) |
| 430 | # |
| 431 | # Since: 1.5 |
| 432 | # |
| 433 | # Example: |
| 434 | # |
| 435 | # <- { "event": "GUEST_PANICKED", |
Victor Toso | 1c4ec79 | 2022-03-28 16:06:00 +0200 | [diff] [blame] | 436 | # "data": { "action": "pause" }, |
| 437 | # "timestamp": { "seconds": 1648245231, "microseconds": 900001 } } |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 438 | # |
| 439 | ## |
| 440 | { 'event': 'GUEST_PANICKED', |
| 441 | 'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } } |
| 442 | |
| 443 | ## |
zhenwei pi | 7dc58de | 2020-01-14 10:31:02 +0800 | [diff] [blame] | 444 | # @GUEST_CRASHLOADED: |
| 445 | # |
| 446 | # Emitted when guest OS crash loaded is detected |
| 447 | # |
| 448 | # @action: action that has been taken, currently always "run" |
| 449 | # |
| 450 | # @info: information about a panic |
| 451 | # |
| 452 | # Since: 5.0 |
| 453 | # |
| 454 | # Example: |
| 455 | # |
| 456 | # <- { "event": "GUEST_CRASHLOADED", |
Victor Toso | 1c4ec79 | 2022-03-28 16:06:00 +0200 | [diff] [blame] | 457 | # "data": { "action": "run" }, |
| 458 | # "timestamp": { "seconds": 1648245259, "microseconds": 893771 } } |
zhenwei pi | 7dc58de | 2020-01-14 10:31:02 +0800 | [diff] [blame] | 459 | # |
| 460 | ## |
| 461 | { 'event': 'GUEST_CRASHLOADED', |
| 462 | 'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } } |
| 463 | |
| 464 | ## |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 465 | # @GuestPanicAction: |
| 466 | # |
| 467 | # An enumeration of the actions taken when guest OS panic is detected |
| 468 | # |
| 469 | # @pause: system pauses |
| 470 | # |
zhenwei pi | 7dc58de | 2020-01-14 10:31:02 +0800 | [diff] [blame] | 471 | # Since: 2.1 (poweroff since 2.8, run since 5.0) |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 472 | ## |
| 473 | { 'enum': 'GuestPanicAction', |
zhenwei pi | 7dc58de | 2020-01-14 10:31:02 +0800 | [diff] [blame] | 474 | 'data': [ 'pause', 'poweroff', 'run' ] } |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 475 | |
| 476 | ## |
| 477 | # @GuestPanicInformationType: |
| 478 | # |
| 479 | # An enumeration of the guest panic information types |
| 480 | # |
Christian Borntraeger | 4ada99a | 2018-02-09 12:25:43 +0000 | [diff] [blame] | 481 | # @hyper-v: hyper-v guest panic information type |
| 482 | # |
| 483 | # @s390: s390 guest panic information type (Since: 2.12) |
| 484 | # |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 485 | # Since: 2.9 |
| 486 | ## |
| 487 | { 'enum': 'GuestPanicInformationType', |
Christian Borntraeger | 4ada99a | 2018-02-09 12:25:43 +0000 | [diff] [blame] | 488 | 'data': [ 'hyper-v', 's390' ] } |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 489 | |
| 490 | ## |
| 491 | # @GuestPanicInformation: |
| 492 | # |
| 493 | # Information about a guest panic |
| 494 | # |
Christian Borntraeger | 4ada99a | 2018-02-09 12:25:43 +0000 | [diff] [blame] | 495 | # @type: Crash type that defines the hypervisor specific information |
| 496 | # |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 497 | # Since: 2.9 |
| 498 | ## |
| 499 | {'union': 'GuestPanicInformation', |
| 500 | 'base': {'type': 'GuestPanicInformationType'}, |
| 501 | 'discriminator': 'type', |
Christian Borntraeger | 4ada99a | 2018-02-09 12:25:43 +0000 | [diff] [blame] | 502 | 'data': { 'hyper-v': 'GuestPanicInformationHyperV', |
| 503 | 's390': 'GuestPanicInformationS390' } } |
Markus Armbruster | 0e201d3 | 2017-08-24 21:13:57 +0200 | [diff] [blame] | 504 | |
| 505 | ## |
| 506 | # @GuestPanicInformationHyperV: |
| 507 | # |
| 508 | # Hyper-V specific guest panic information (HV crash MSRs) |
| 509 | # |
| 510 | # Since: 2.9 |
| 511 | ## |
| 512 | {'struct': 'GuestPanicInformationHyperV', |
| 513 | 'data': { 'arg1': 'uint64', |
| 514 | 'arg2': 'uint64', |
| 515 | 'arg3': 'uint64', |
| 516 | 'arg4': 'uint64', |
| 517 | 'arg5': 'uint64' } } |
Christian Borntraeger | 4ada99a | 2018-02-09 12:25:43 +0000 | [diff] [blame] | 518 | |
| 519 | ## |
| 520 | # @S390CrashReason: |
| 521 | # |
| 522 | # Reason why the CPU is in a crashed state. |
| 523 | # |
| 524 | # @unknown: no crash reason was set |
| 525 | # |
| 526 | # @disabled-wait: the CPU has entered a disabled wait state |
| 527 | # |
| 528 | # @extint-loop: clock comparator or cpu timer interrupt with new PSW enabled |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 529 | # for external interrupts |
Christian Borntraeger | 4ada99a | 2018-02-09 12:25:43 +0000 | [diff] [blame] | 530 | # |
| 531 | # @pgmint-loop: program interrupt with BAD new PSW |
| 532 | # |
| 533 | # @opint-loop: operation exception interrupt with invalid code at the program |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 534 | # interrupt new PSW |
Christian Borntraeger | 4ada99a | 2018-02-09 12:25:43 +0000 | [diff] [blame] | 535 | # |
| 536 | # Since: 2.12 |
| 537 | ## |
| 538 | { 'enum': 'S390CrashReason', |
| 539 | 'data': [ 'unknown', |
| 540 | 'disabled-wait', |
| 541 | 'extint-loop', |
| 542 | 'pgmint-loop', |
| 543 | 'opint-loop' ] } |
| 544 | |
| 545 | ## |
| 546 | # @GuestPanicInformationS390: |
| 547 | # |
| 548 | # S390 specific guest panic information (PSW) |
| 549 | # |
| 550 | # @core: core id of the CPU that crashed |
| 551 | # @psw-mask: control fields of guest PSW |
| 552 | # @psw-addr: guest instruction address |
| 553 | # @reason: guest crash reason |
| 554 | # |
| 555 | # Since: 2.12 |
| 556 | ## |
| 557 | {'struct': 'GuestPanicInformationS390', |
| 558 | 'data': { 'core': 'uint32', |
| 559 | 'psw-mask': 'uint64', |
| 560 | 'psw-addr': 'uint64', |
| 561 | 'reason': 'S390CrashReason' } } |
zhenwei pi | 77b285f | 2020-09-30 18:04:39 +0800 | [diff] [blame] | 562 | |
| 563 | ## |
| 564 | # @MEMORY_FAILURE: |
| 565 | # |
| 566 | # Emitted when a memory failure occurs on host side. |
| 567 | # |
| 568 | # @recipient: recipient is defined as @MemoryFailureRecipient. |
| 569 | # |
| 570 | # @action: action that has been taken. action is defined as @MemoryFailureAction. |
| 571 | # |
| 572 | # @flags: flags for MemoryFailureAction. action is defined as @MemoryFailureFlags. |
| 573 | # |
| 574 | # Since: 5.2 |
| 575 | # |
| 576 | # Example: |
| 577 | # |
| 578 | # <- { "event": "MEMORY_FAILURE", |
| 579 | # "data": { "recipient": "hypervisor", |
| 580 | # "action": "fatal", |
Victor Toso | 05df03c | 2022-03-28 16:06:01 +0200 | [diff] [blame] | 581 | # "flags": { "action-required": false, |
| 582 | # "recursive": false } }, |
| 583 | # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } } |
zhenwei pi | 77b285f | 2020-09-30 18:04:39 +0800 | [diff] [blame] | 584 | # |
| 585 | ## |
| 586 | { 'event': 'MEMORY_FAILURE', |
| 587 | 'data': { 'recipient': 'MemoryFailureRecipient', |
| 588 | 'action': 'MemoryFailureAction', |
| 589 | 'flags': 'MemoryFailureFlags'} } |
| 590 | |
| 591 | ## |
| 592 | # @MemoryFailureRecipient: |
| 593 | # |
| 594 | # Hardware memory failure occurs, handled by recipient. |
| 595 | # |
| 596 | # @hypervisor: memory failure at QEMU process address space. |
| 597 | # (none guest memory, but used by QEMU itself). |
| 598 | # |
| 599 | # @guest: memory failure at guest memory, |
| 600 | # |
| 601 | # Since: 5.2 |
zhenwei pi | 77b285f | 2020-09-30 18:04:39 +0800 | [diff] [blame] | 602 | ## |
| 603 | { 'enum': 'MemoryFailureRecipient', |
| 604 | 'data': [ 'hypervisor', |
| 605 | 'guest' ] } |
| 606 | |
zhenwei pi | 77b285f | 2020-09-30 18:04:39 +0800 | [diff] [blame] | 607 | ## |
| 608 | # @MemoryFailureAction: |
| 609 | # |
| 610 | # Actions taken by QEMU in response to a hardware memory failure. |
| 611 | # |
| 612 | # @ignore: the memory failure could be ignored. This will only be the case |
| 613 | # for action-optional failures. |
| 614 | # |
| 615 | # @inject: memory failure occurred in guest memory, the guest enabled MCE |
| 616 | # handling mechanism, and QEMU could inject the MCE into the guest |
| 617 | # successfully. |
| 618 | # |
| 619 | # @fatal: the failure is unrecoverable. This occurs for action-required |
| 620 | # failures if the recipient is the hypervisor; QEMU will exit. |
| 621 | # |
| 622 | # @reset: the failure is unrecoverable but confined to the guest. This |
| 623 | # occurs if the recipient is a guest guest which is not ready |
| 624 | # to handle memory failures. |
| 625 | # |
| 626 | # Since: 5.2 |
zhenwei pi | 77b285f | 2020-09-30 18:04:39 +0800 | [diff] [blame] | 627 | ## |
| 628 | { 'enum': 'MemoryFailureAction', |
| 629 | 'data': [ 'ignore', |
| 630 | 'inject', |
| 631 | 'fatal', |
| 632 | 'reset' ] } |
| 633 | |
| 634 | ## |
| 635 | # @MemoryFailureFlags: |
| 636 | # |
| 637 | # Additional information on memory failures. |
| 638 | # |
| 639 | # @action-required: whether a memory failure event is action-required |
| 640 | # or action-optional (e.g. a failure during memory scrub). |
| 641 | # |
| 642 | # @recursive: whether the failure occurred while the previous |
| 643 | # failure was still in progress. |
| 644 | # |
| 645 | # Since: 5.2 |
zhenwei pi | 77b285f | 2020-09-30 18:04:39 +0800 | [diff] [blame] | 646 | ## |
| 647 | { 'struct': 'MemoryFailureFlags', |
| 648 | 'data': { 'action-required': 'bool', |
| 649 | 'recursive': 'bool'} } |
Chenyi Qiang | e2e69f6 | 2022-09-29 15:20:14 +0800 | [diff] [blame] | 650 | |
| 651 | ## |
| 652 | # @NotifyVmexitOption: |
| 653 | # |
| 654 | # An enumeration of the options specified when enabling notify VM exit |
| 655 | # |
| 656 | # @run: enable the feature, do nothing and continue if the notify VM exit happens. |
| 657 | # |
| 658 | # @internal-error: enable the feature, raise a internal error if the notify |
| 659 | # VM exit happens. |
| 660 | # |
| 661 | # @disable: disable the feature. |
| 662 | # |
| 663 | # Since: 7.2 |
| 664 | ## |
| 665 | { 'enum': 'NotifyVmexitOption', |
| 666 | 'data': [ 'run', 'internal-error', 'disable' ] } |