docs: update BLOCK_IMAGE_CORRUPTED documentation
[qemu.git] / docs / qmp / qmp-events.txt
blob64ba46c769d229b846a8230de33fed5f9cc45e42
1                    QEMU Machine Protocol Events
2                    ============================
4 ACPI_DEVICE_OST
5 ---------------
7 Emitted when guest executes ACPI _OST method.
9  - data: ACPIOSTInfo type as described in qapi-schema.json
11 { "event": "ACPI_DEVICE_OST",
12      "data": { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0 } }
14 BALLOON_CHANGE
15 --------------
17 Emitted when the guest changes the actual BALLOON level. This
18 value is equivalent to the 'actual' field return by the
19 'query-balloon' command
21 Data:
23 - "actual": actual level of the guest memory balloon in bytes (json-number)
25 Example:
27 { "event": "BALLOON_CHANGE",
28     "data": { "actual": 944766976 },
29     "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
31 BLOCK_IMAGE_CORRUPTED
32 ---------------------
34 Emitted when a disk image is being marked corrupt. The image can be
35 identified by its device or node name. The 'device' field is always
36 present for compatibility reasons, but it can be empty ("") if the
37 image does not have a device name associated.
39 Data:
41 - "device":    Device name (json-string)
42 - "node-name": Node name (json-string, optional)
43 - "msg":       Informative message (e.g., reason for the corruption)
44                (json-string)
45 - "offset":    If the corruption resulted from an image access, this
46                is the host's access offset into the image
47                (json-int, optional)
48 - "size":      If the corruption resulted from an image access, this
49                is the access size (json-int, optional)
51 Example:
53 { "event": "BLOCK_IMAGE_CORRUPTED",
54     "data": { "device": "ide0-hd0", "node-name": "node0",
55         "msg": "Prevented active L1 table overwrite", "offset": 196608,
56         "size": 65536 },
57     "timestamp": { "seconds": 1378126126, "microseconds": 966463 } }
59 BLOCK_IO_ERROR
60 --------------
62 Emitted when a disk I/O error occurs.
64 Data:
66 - "device": device name (json-string)
67 - "operation": I/O operation (json-string, "read" or "write")
68 - "action": action that has been taken, it's one of the following (json-string):
69     "ignore": error has been ignored
70     "report": error has been reported to the device
71     "stop": the VM is going to stop because of the error
73 Example:
75 { "event": "BLOCK_IO_ERROR",
76     "data": { "device": "ide0-hd1",
77               "operation": "write",
78               "action": "stop" },
79     "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
81 Note: If action is "stop", a STOP event will eventually follow the
82 BLOCK_IO_ERROR event.
84 BLOCK_JOB_CANCELLED
85 -------------------
87 Emitted when a block job has been cancelled.
89 Data:
91 - "type":     Job type (json-string; "stream" for image streaming
92                                      "commit" for block commit)
93 - "device":   Device name (json-string)
94 - "len":      Maximum progress value (json-int)
95 - "offset":   Current progress value (json-int)
96               On success this is equal to len.
97               On failure this is less than len.
98 - "speed":    Rate limit, bytes per second (json-int)
100 Example:
102 { "event": "BLOCK_JOB_CANCELLED",
103      "data": { "type": "stream", "device": "virtio-disk0",
104                "len": 10737418240, "offset": 134217728,
105                "speed": 0 },
106      "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
108 BLOCK_JOB_COMPLETED
109 -------------------
111 Emitted when a block job has completed.
113 Data:
115 - "type":     Job type (json-string; "stream" for image streaming
116                                      "commit" for block commit)
117 - "device":   Device name (json-string)
118 - "len":      Maximum progress value (json-int)
119 - "offset":   Current progress value (json-int)
120               On success this is equal to len.
121               On failure this is less than len.
122 - "speed":    Rate limit, bytes per second (json-int)
123 - "error":    Error message (json-string, optional)
124               Only present on failure.  This field contains a human-readable
125               error message.  There are no semantics other than that streaming
126               has failed and clients should not try to interpret the error
127               string.
129 Example:
131 { "event": "BLOCK_JOB_COMPLETED",
132      "data": { "type": "stream", "device": "virtio-disk0",
133                "len": 10737418240, "offset": 10737418240,
134                "speed": 0 },
135      "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
137 BLOCK_JOB_ERROR
138 ---------------
140 Emitted when a block job encounters an error.
142 Data:
144 - "device": device name (json-string)
145 - "operation": I/O operation (json-string, "read" or "write")
146 - "action": action that has been taken, it's one of the following (json-string):
147     "ignore": error has been ignored, the job may fail later
148     "report": error will be reported and the job canceled
149     "stop": error caused job to be paused
151 Example:
153 { "event": "BLOCK_JOB_ERROR",
154     "data": { "device": "ide0-hd1",
155               "operation": "write",
156               "action": "stop" },
157     "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
159 BLOCK_JOB_READY
160 ---------------
162 Emitted when a block job is ready to complete.
164 Data:
166 - "type":     Job type (json-string; "stream" for image streaming
167                                      "commit" for block commit)
168 - "device":   Device name (json-string)
169 - "len":      Maximum progress value (json-int)
170 - "offset":   Current progress value (json-int)
171               On success this is equal to len.
172               On failure this is less than len.
173 - "speed":    Rate limit, bytes per second (json-int)
175 Example:
177 { "event": "BLOCK_JOB_READY",
178     "data": { "device": "drive0", "type": "mirror", "speed": 0,
179               "len": 2097152, "offset": 2097152 }
180     "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
182 Note: The "ready to complete" status is always reset by a BLOCK_JOB_ERROR
183 event.
185 DEVICE_DELETED
186 --------------
188 Emitted whenever the device removal completion is acknowledged
189 by the guest.
190 At this point, it's safe to reuse the specified device ID.
191 Device removal can be initiated by the guest or by HMP/QMP commands.
193 Data:
195 - "device": device name (json-string, optional)
196 - "path": device path (json-string)
198 { "event": "DEVICE_DELETED",
199   "data": { "device": "virtio-net-pci-0",
200             "path": "/machine/peripheral/virtio-net-pci-0" },
201   "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
203 DEVICE_TRAY_MOVED
204 -----------------
206 It's emitted whenever the tray of a removable device is moved by the guest
207 or by HMP/QMP commands.
209 Data:
211 - "device": device name (json-string)
212 - "tray-open": true if the tray has been opened or false if it has been closed
213                (json-bool)
215 { "event": "DEVICE_TRAY_MOVED",
216   "data": { "device": "ide1-cd0",
217             "tray-open": true
218   },
219   "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
221 GUEST_PANICKED
222 --------------
224 Emitted when guest OS panic is detected.
226 Data:
228 - "action": Action that has been taken (json-string, currently always "pause").
230 Example:
232 { "event": "GUEST_PANICKED",
233      "data": { "action": "pause" } }
235 NIC_RX_FILTER_CHANGED
236 ---------------------
238 The event is emitted once until the query command is executed,
239 the first event will always be emitted.
241 Data:
243 - "name": net client name (json-string)
244 - "path": device path (json-string)
246 { "event": "NIC_RX_FILTER_CHANGED",
247   "data": { "name": "vnet0",
248             "path": "/machine/peripheral/vnet0/virtio-backend" },
249   "timestamp": { "seconds": 1368697518, "microseconds": 326866 } }
252 POWERDOWN
253 ---------
255 Emitted when the Virtual Machine is powered down through the power
256 control system, such as via ACPI.
258 Data: None.
260 Example:
262 { "event": "POWERDOWN",
263     "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
265 QUORUM_FAILURE
266 --------------
268 Emitted by the Quorum block driver if it fails to establish a quorum.
270 Data:
272 - "reference":     device name if defined else node name.
273 - "sector-num":    Number of the first sector of the failed read operation.
274 - "sectors-count": Failed read operation sector count.
276 Example:
278 { "event": "QUORUM_FAILURE",
279      "data": { "reference": "usr1", "sector-num": 345435, "sectors-count": 5 },
280      "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
282 QUORUM_REPORT_BAD
283 -----------------
285 Emitted to report a corruption of a Quorum file.
287 Data:
289 - "error":         Error message (json-string, optional)
290                    Only present on failure.  This field contains a human-readable
291                    error message.  There are no semantics other than that the
292                    block layer reported an error and clients should not try to
293                    interpret the error string.
294 - "node-name":     The graph node name of the block driver state.
295 - "sector-num":    Number of the first sector of the failed read operation.
296 - "sectors-count": Failed read operation sector count.
298 Example:
300 { "event": "QUORUM_REPORT_BAD",
301      "data": { "node-name": "1.raw", "sector-num": 345435, "sectors-count": 5 },
302      "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
304 RESET
305 -----
307 Emitted when the Virtual Machine is reset.
309 Data: None.
311 Example:
313 { "event": "RESET",
314     "timestamp": { "seconds": 1267041653, "microseconds": 9518 } }
316 RESUME
317 ------
319 Emitted when the Virtual Machine resumes execution.
321 Data: None.
323 Example:
325 { "event": "RESUME",
326     "timestamp": { "seconds": 1271770767, "microseconds": 582542 } }
328 RTC_CHANGE
329 ----------
331 Emitted when the guest changes the RTC time.
333 Data:
335 - "offset": Offset between base RTC clock (as specified by -rtc base), and
336 new RTC clock value (json-number)
338 Example:
340 { "event": "RTC_CHANGE",
341     "data": { "offset": 78 },
342     "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
344 SHUTDOWN
345 --------
347 Emitted when the Virtual Machine has shut down, indicating that qemu
348 is about to exit.
350 Data: None.
352 Example:
354 { "event": "SHUTDOWN",
355     "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
357 Note: If the command-line option "-no-shutdown" has been specified, a STOP
358 event will eventually follow the SHUTDOWN event.
360 SPICE_CONNECTED
361 ---------------
363 Emitted when a SPICE client connects.
365 Data:
367 - "server": Server information (json-object)
368   - "host": IP address (json-string)
369   - "port": port number (json-string)
370   - "family": address family (json-string, "ipv4" or "ipv6")
371 - "client": Client information (json-object)
372   - "host": IP address (json-string)
373   - "port": port number (json-string)
374   - "family": address family (json-string, "ipv4" or "ipv6")
376 Example:
378 { "timestamp": {"seconds": 1290688046, "microseconds": 388707},
379   "event": "SPICE_CONNECTED",
380   "data": {
381     "server": { "port": "5920", "family": "ipv4", "host": "127.0.0.1"},
382     "client": {"port": "52873", "family": "ipv4", "host": "127.0.0.1"}
385 SPICE_DISCONNECTED
386 ------------------
388 Emitted when a SPICE client disconnects.
390 Data:
392 - "server": Server information (json-object)
393   - "host": IP address (json-string)
394   - "port": port number (json-string)
395   - "family": address family (json-string, "ipv4" or "ipv6")
396 - "client": Client information (json-object)
397   - "host": IP address (json-string)
398   - "port": port number (json-string)
399   - "family": address family (json-string, "ipv4" or "ipv6")
401 Example:
403 { "timestamp": {"seconds": 1290688046, "microseconds": 388707},
404   "event": "SPICE_DISCONNECTED",
405   "data": {
406     "server": { "port": "5920", "family": "ipv4", "host": "127.0.0.1"},
407     "client": {"port": "52873", "family": "ipv4", "host": "127.0.0.1"}
410 SPICE_INITIALIZED
411 -----------------
413 Emitted after initial handshake and authentication takes place (if any)
414 and the SPICE channel is up and running
416 Data:
418 - "server": Server information (json-object)
419   - "host": IP address (json-string)
420   - "port": port number (json-string)
421   - "family": address family (json-string, "ipv4" or "ipv6")
422   - "auth": authentication method (json-string, optional)
423 - "client": Client information (json-object)
424   - "host": IP address (json-string)
425   - "port": port number (json-string)
426   - "family": address family (json-string, "ipv4" or "ipv6")
427   - "connection-id": spice connection id.  All channels with the same id
428                      belong to the same spice session (json-int)
429   - "channel-type": channel type.  "1" is the main control channel, filter for
430                     this one if you want track spice sessions only (json-int)
431   - "channel-id": channel id.  Usually "0", might be different needed when
432                   multiple channels of the same type exist, such as multiple
433                   display channels in a multihead setup (json-int)
434   - "tls": whevener the channel is encrypted (json-bool)
436 Example:
438 { "timestamp": {"seconds": 1290688046, "microseconds": 417172},
439   "event": "SPICE_INITIALIZED",
440   "data": {"server": {"auth": "spice", "port": "5921",
441                       "family": "ipv4", "host": "127.0.0.1"},
442            "client": {"port": "49004", "family": "ipv4", "channel-type": 3,
443                       "connection-id": 1804289383, "host": "127.0.0.1",
444                       "channel-id": 0, "tls": true}
447 SPICE_MIGRATE_COMPLETED
448 -----------------------
450 Emitted when SPICE migration has completed
452 Data: None.
454 Example:
456 { "timestamp": {"seconds": 1290688046, "microseconds": 417172},
457   "event": "SPICE_MIGRATE_COMPLETED" }
460 STOP
461 ----
463 Emitted when the Virtual Machine is stopped.
465 Data: None.
467 Example:
469 { "event": "STOP",
470     "timestamp": { "seconds": 1267041730, "microseconds": 281295 } }
472 SUSPEND
473 -------
475 Emitted when guest enters S3 state.
477 Data: None.
479 Example:
481 { "event": "SUSPEND",
482      "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
484 SUSPEND_DISK
485 ------------
487 Emitted when the guest makes a request to enter S4 state.
489 Data: None.
491 Example:
493 { "event": "SUSPEND_DISK",
494      "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
496 Note: QEMU shuts down when entering S4 state.
498 VNC_CONNECTED
499 -------------
501 Emitted when a VNC client establishes a connection.
503 Data:
505 - "server": Server information (json-object)
506   - "host": IP address (json-string)
507   - "service": port number (json-string)
508   - "family": address family (json-string, "ipv4" or "ipv6")
509   - "auth": authentication method (json-string, optional)
510 - "client": Client information (json-object)
511   - "host": IP address (json-string)
512   - "service": port number (json-string)
513   - "family": address family (json-string, "ipv4" or "ipv6")
515 Example:
517 { "event": "VNC_CONNECTED",
518     "data": {
519         "server": { "auth": "sasl", "family": "ipv4",
520                     "service": "5901", "host": "0.0.0.0" },
521         "client": { "family": "ipv4", "service": "58425",
522                     "host": "127.0.0.1" } },
523     "timestamp": { "seconds": 1262976601, "microseconds": 975795 } }
526 Note: This event is emitted before any authentication takes place, thus
527 the authentication ID is not provided.
529 VNC_DISCONNECTED
530 ----------------
532 Emitted when the connection is closed.
534 Data:
536 - "server": Server information (json-object)
537   - "host": IP address (json-string)
538   - "service": port number (json-string)
539   - "family": address family (json-string, "ipv4" or "ipv6")
540   - "auth": authentication method (json-string, optional)
541 - "client": Client information (json-object)
542   - "host": IP address (json-string)
543   - "service": port number (json-string)
544   - "family": address family (json-string, "ipv4" or "ipv6")
545   - "x509_dname": TLS dname (json-string, optional)
546   - "sasl_username": SASL username (json-string, optional)
548 Example:
550 { "event": "VNC_DISCONNECTED",
551     "data": {
552         "server": { "auth": "sasl", "family": "ipv4",
553                     "service": "5901", "host": "0.0.0.0" },
554         "client": { "family": "ipv4", "service": "58425",
555                     "host": "127.0.0.1", "sasl_username": "luiz" } },
556     "timestamp": { "seconds": 1262976601, "microseconds": 975795 } }
558 VNC_INITIALIZED
559 ---------------
561 Emitted after authentication takes place (if any) and the VNC session is
562 made active.
564 Data:
566 - "server": Server information (json-object)
567   - "host": IP address (json-string)
568   - "service": port number (json-string)
569   - "family": address family (json-string, "ipv4" or "ipv6")
570   - "auth": authentication method (json-string, optional)
571 - "client": Client information (json-object)
572   - "host": IP address (json-string)
573   - "service": port number (json-string)
574   - "family": address family (json-string, "ipv4" or "ipv6")
575   - "x509_dname": TLS dname (json-string, optional)
576   - "sasl_username": SASL username (json-string, optional)
578 Example:
580 { "event": "VNC_INITIALIZED",
581     "data": {
582         "server": { "auth": "sasl", "family": "ipv4",
583                     "service": "5901", "host": "0.0.0.0"},
584         "client": { "family": "ipv4", "service": "46089",
585                     "host": "127.0.0.1", "sasl_username": "luiz" } },
586         "timestamp": { "seconds": 1263475302, "microseconds": 150772 } }
588 VSERPORT_CHANGE
589 ---------------
591 Emitted when the guest opens or closes a virtio-serial port.
593 Data:
595 - "id": device identifier of the virtio-serial port (json-string)
596 - "open": true if the guest has opened the virtio-serial port (json-bool)
598 Example:
600 { "event": "VSERPORT_CHANGE",
601     "data": { "id": "channel0", "open": true },
602     "timestamp": { "seconds": 1401385907, "microseconds": 422329 } }
604 WAKEUP
605 ------
607 Emitted when the guest has woken up from S3 and is running.
609 Data: None.
611 Example:
613 { "event": "WAKEUP",
614      "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
616 WATCHDOG
617 --------
619 Emitted when the watchdog device's timer is expired.
621 Data:
623 - "action": Action that has been taken, it's one of the following (json-string):
624             "reset", "shutdown", "poweroff", "pause", "debug", or "none"
626 Example:
628 { "event": "WATCHDOG",
629      "data": { "action": "reset" },
630      "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
632 Note: If action is "reset", "shutdown", or "pause" the WATCHDOG event is
633 followed respectively by the RESET, SHUTDOWN, or STOP events.