block: don't lose data from last incomplete sector
[qemu/kevin.git] / QMP / qmp-events.txt
blob4b24ec900de6688e7f8385a78f6747365b051fc4
1                    QEMU Monitor Protocol Events
2                    ============================
4 BALLOON_CHANGE
5 --------------
7 Emitted when the guest changes the actual BALLOON level. This
8 value is equivalent to the 'actual' field return by the
9 'query-balloon' command
11 Data:
13 - "actual": actual level of the guest memory balloon in bytes (json-number)
15 Example:
17 { "event": "BALLOON_CHANGE",
18     "data": { "actual": 944766976 },
19     "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
21 BLOCK_IMAGE_CORRUPTED
22 ---------------------
24 Emitted when a disk image is being marked corrupt.
26 Data:
28 - "device": Device name (json-string)
29 - "msg":    Informative message (e.g., reason for the corruption) (json-string)
30 - "offset": If the corruption resulted from an image access, this is the access
31             offset into the image (json-int)
32 - "size":   If the corruption resulted from an image access, this is the access
33             size (json-int)
35 Example:
37 { "event": "BLOCK_IMAGE_CORRUPTED",
38     "data": { "device": "ide0-hd0",
39         "msg": "Prevented active L1 table overwrite", "offset": 196608,
40         "size": 65536 },
41     "timestamp": { "seconds": 1378126126, "microseconds": 966463 } }
43 BLOCK_IO_ERROR
44 --------------
46 Emitted when a disk I/O error occurs.
48 Data:
50 - "device": device name (json-string)
51 - "operation": I/O operation (json-string, "read" or "write")
52 - "action": action that has been taken, it's one of the following (json-string):
53     "ignore": error has been ignored
54     "report": error has been reported to the device
55     "stop": error caused VM to be stopped
57 Example:
59 { "event": "BLOCK_IO_ERROR",
60     "data": { "device": "ide0-hd1",
61               "operation": "write",
62               "action": "stop" },
63     "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
65 Note: If action is "stop", a STOP event will eventually follow the
66 BLOCK_IO_ERROR event.
68 BLOCK_JOB_CANCELLED
69 -------------------
71 Emitted when a block job has been cancelled.
73 Data:
75 - "type":     Job type (json-string; "stream" for image streaming
76                                      "commit" for block commit)
77 - "device":   Device name (json-string)
78 - "len":      Maximum progress value (json-int)
79 - "offset":   Current progress value (json-int)
80               On success this is equal to len.
81               On failure this is less than len.
82 - "speed":    Rate limit, bytes per second (json-int)
84 Example:
86 { "event": "BLOCK_JOB_CANCELLED",
87      "data": { "type": "stream", "device": "virtio-disk0",
88                "len": 10737418240, "offset": 134217728,
89                "speed": 0 },
90      "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
92 BLOCK_JOB_COMPLETED
93 -------------------
95 Emitted when a block job has completed.
97 Data:
99 - "type":     Job type (json-string; "stream" for image streaming
100                                      "commit" for block commit)
101 - "device":   Device name (json-string)
102 - "len":      Maximum progress value (json-int)
103 - "offset":   Current progress value (json-int)
104               On success this is equal to len.
105               On failure this is less than len.
106 - "speed":    Rate limit, bytes per second (json-int)
107 - "error":    Error message (json-string, optional)
108               Only present on failure.  This field contains a human-readable
109               error message.  There are no semantics other than that streaming
110               has failed and clients should not try to interpret the error
111               string.
113 Example:
115 { "event": "BLOCK_JOB_COMPLETED",
116      "data": { "type": "stream", "device": "virtio-disk0",
117                "len": 10737418240, "offset": 10737418240,
118                "speed": 0 },
119      "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
121 BLOCK_JOB_ERROR
122 ---------------
124 Emitted when a block job encounters an error.
126 Data:
128 - "device": device name (json-string)
129 - "operation": I/O operation (json-string, "read" or "write")
130 - "action": action that has been taken, it's one of the following (json-string):
131     "ignore": error has been ignored, the job may fail later
132     "report": error will be reported and the job canceled
133     "stop": error caused job to be paused
135 Example:
137 { "event": "BLOCK_JOB_ERROR",
138     "data": { "device": "ide0-hd1",
139               "operation": "write",
140               "action": "stop" },
141     "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
143 BLOCK_JOB_READY
144 ---------------
146 Emitted when a block job is ready to complete.
148 Data:
150 - "device": device name (json-string)
152 Example:
154 { "event": "BLOCK_JOB_READY",
155     "data": { "device": "ide0-hd1" },
156     "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
158 Note: The "ready to complete" status is always reset by a BLOCK_JOB_ERROR
159 event.
161 DEVICE_DELETED
162 -----------------
164 Emitted whenever the device removal completion is acknowledged
165 by the guest.
166 At this point, it's safe to reuse the specified device ID.
167 Device removal can be initiated by the guest or by HMP/QMP commands.
169 Data:
171 - "device": device name (json-string, optional)
172 - "path": device path (json-string)
174 { "event": "DEVICE_DELETED",
175   "data": { "device": "virtio-net-pci-0",
176             "path": "/machine/peripheral/virtio-net-pci-0" },
177   "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
179 DEVICE_TRAY_MOVED
180 -----------------
182 It's emitted whenever the tray of a removable device is moved by the guest
183 or by HMP/QMP commands.
185 Data:
187 - "device": device name (json-string)
188 - "tray-open": true if the tray has been opened or false if it has been closed
189                (json-bool)
191 { "event": "DEVICE_TRAY_MOVED",
192   "data": { "device": "ide1-cd0",
193             "tray-open": true
194   },
195   "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
197 NIC_RX_FILTER_CHANGED
198 -----------------
200 The event is emitted once until the query command is executed,
201 the first event will always be emitted.
203 Data:
205 - "name": net client name (json-string)
206 - "path": device path (json-string)
208 { "event": "NIC_RX_FILTER_CHANGED",
209   "data": { "name": "vnet0",
210             "path": "/machine/peripheral/vnet0/virtio-backend" },
211   "timestamp": { "seconds": 1368697518, "microseconds": 326866 } }
214 RESET
215 -----
217 Emitted when the Virtual Machine is reseted.
219 Data: None.
221 Example:
223 { "event": "RESET",
224     "timestamp": { "seconds": 1267041653, "microseconds": 9518 } }
226 RESUME
227 ------
229 Emitted when the Virtual Machine resumes execution.
231 Data: None.
233 Example:
235 { "event": "RESUME",
236     "timestamp": { "seconds": 1271770767, "microseconds": 582542 } }
238 RTC_CHANGE
239 ----------
241 Emitted when the guest changes the RTC time.
243 Data:
245 - "offset": Offset between base RTC clock (as specified by -rtc base), and
246 new RTC clock value (json-number)
248 Example:
250 { "event": "RTC_CHANGE",
251     "data": { "offset": 78 },
252     "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
254 SHUTDOWN
255 --------
257 Emitted when the Virtual Machine is powered down.
259 Data: None.
261 Example:
263 { "event": "SHUTDOWN",
264     "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
266 Note: If the command-line option "-no-shutdown" has been specified, a STOP
267 event will eventually follow the SHUTDOWN event.
269 SPICE_CONNECTED, SPICE_DISCONNECTED
270 -----------------------------------
272 Emitted when a SPICE client connects or disconnects.
274 Data:
276 - "server": Server information (json-object)
277   - "host": IP address (json-string)
278   - "port": port number (json-string)
279   - "family": address family (json-string, "ipv4" or "ipv6")
280 - "client": Client information (json-object)
281   - "host": IP address (json-string)
282   - "port": port number (json-string)
283   - "family": address family (json-string, "ipv4" or "ipv6")
285 Example:
287 { "timestamp": {"seconds": 1290688046, "microseconds": 388707},
288   "event": "SPICE_CONNECTED",
289   "data": {
290     "server": { "port": "5920", "family": "ipv4", "host": "127.0.0.1"},
291     "client": {"port": "52873", "family": "ipv4", "host": "127.0.0.1"}
294 SPICE_INITIALIZED
295 -----------------
297 Emitted after initial handshake and authentication takes place (if any)
298 and the SPICE channel is up'n'running
300 Data:
302 - "server": Server information (json-object)
303   - "host": IP address (json-string)
304   - "port": port number (json-string)
305   - "family": address family (json-string, "ipv4" or "ipv6")
306   - "auth": authentication method (json-string, optional)
307 - "client": Client information (json-object)
308   - "host": IP address (json-string)
309   - "port": port number (json-string)
310   - "family": address family (json-string, "ipv4" or "ipv6")
311   - "connection-id": spice connection id.  All channels with the same id
312                      belong to the same spice session (json-int)
313   - "channel-type": channel type.  "1" is the main control channel, filter for
314                     this one if you want track spice sessions only (json-int)
315   - "channel-id": channel id.  Usually "0", might be different needed when
316                   multiple channels of the same type exist, such as multiple
317                   display channels in a multihead setup (json-int)
318   - "tls": whevener the channel is encrypted (json-bool)
320 Example:
322 { "timestamp": {"seconds": 1290688046, "microseconds": 417172},
323   "event": "SPICE_INITIALIZED",
324   "data": {"server": {"auth": "spice", "port": "5921",
325                       "family": "ipv4", "host": "127.0.0.1"},
326            "client": {"port": "49004", "family": "ipv4", "channel-type": 3,
327                       "connection-id": 1804289383, "host": "127.0.0.1",
328                       "channel-id": 0, "tls": true}
331 STOP
332 ----
334 Emitted when the Virtual Machine is stopped.
336 Data: None.
338 Example:
340 { "event": "STOP",
341     "timestamp": { "seconds": 1267041730, "microseconds": 281295 } }
343 SUSPEND
344 -------
346 Emitted when guest enters S3 state.
348 Data: None.
350 Example:
352 { "event": "SUSPEND",
353      "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
355 SUSPEND_DISK
356 ------------
358 Emitted when the guest makes a request to enter S4 state.
360 Data: None.
362 Example:
364 { "event": "SUSPEND_DISK",
365      "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
367 Note: QEMU shuts down when entering S4 state.
369 VNC_CONNECTED
370 -------------
372 Emitted when a VNC client establishes a connection.
374 Data:
376 - "server": Server information (json-object)
377   - "host": IP address (json-string)
378   - "service": port number (json-string)
379   - "family": address family (json-string, "ipv4" or "ipv6")
380   - "auth": authentication method (json-string, optional)
381 - "client": Client information (json-object)
382   - "host": IP address (json-string)
383   - "service": port number (json-string)
384   - "family": address family (json-string, "ipv4" or "ipv6")
386 Example:
388 { "event": "VNC_CONNECTED",
389     "data": {
390         "server": { "auth": "sasl", "family": "ipv4",
391                     "service": "5901", "host": "0.0.0.0" },
392         "client": { "family": "ipv4", "service": "58425",
393                     "host": "127.0.0.1" } },
394     "timestamp": { "seconds": 1262976601, "microseconds": 975795 } }
397 Note: This event is emitted before any authentication takes place, thus
398 the authentication ID is not provided.
400 VNC_DISCONNECTED
401 ----------------
403 Emitted when the connection is closed.
405 Data:
407 - "server": Server information (json-object)
408   - "host": IP address (json-string)
409   - "service": port number (json-string)
410   - "family": address family (json-string, "ipv4" or "ipv6")
411   - "auth": authentication method (json-string, optional)
412 - "client": Client information (json-object)
413   - "host": IP address (json-string)
414   - "service": port number (json-string)
415   - "family": address family (json-string, "ipv4" or "ipv6")
416   - "x509_dname": TLS dname (json-string, optional)
417   - "sasl_username": SASL username (json-string, optional)
419 Example:
421 { "event": "VNC_DISCONNECTED",
422     "data": {
423         "server": { "auth": "sasl", "family": "ipv4",
424                     "service": "5901", "host": "0.0.0.0" },
425         "client": { "family": "ipv4", "service": "58425",
426                     "host": "127.0.0.1", "sasl_username": "luiz" } },
427     "timestamp": { "seconds": 1262976601, "microseconds": 975795 } }
429 VNC_INITIALIZED
430 ---------------
432 Emitted after authentication takes place (if any) and the VNC session is
433 made active.
435 Data:
437 - "server": Server information (json-object)
438   - "host": IP address (json-string)
439   - "service": port number (json-string)
440   - "family": address family (json-string, "ipv4" or "ipv6")
441   - "auth": authentication method (json-string, optional)
442 - "client": Client information (json-object)
443   - "host": IP address (json-string)
444   - "service": port number (json-string)
445   - "family": address family (json-string, "ipv4" or "ipv6")
446   - "x509_dname": TLS dname (json-string, optional)
447   - "sasl_username": SASL username (json-string, optional)
449 Example:
451 { "event": "VNC_INITIALIZED",
452     "data": {
453         "server": { "auth": "sasl", "family": "ipv4",
454                     "service": "5901", "host": "0.0.0.0"},
455         "client": { "family": "ipv4", "service": "46089",
456                     "host": "127.0.0.1", "sasl_username": "luiz" } },
457         "timestamp": { "seconds": 1263475302, "microseconds": 150772 } }
459 WAKEUP
460 ------
462 Emitted when the guest has woken up from S3 and is running.
464 Data: None.
466 Example:
468 { "event": "WATCHDOG",
469      "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
471 WATCHDOG
472 --------
474 Emitted when the watchdog device's timer is expired.
476 Data:
478 - "action": Action that has been taken, it's one of the following (json-string):
479             "reset", "shutdown", "poweroff", "pause", "debug", or "none"
481 Example:
483 { "event": "WATCHDOG",
484      "data": { "action": "reset" },
485      "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
487 Note: If action is "reset", "shutdown", or "pause" the WATCHDOG event is
488 followed respectively by the RESET, SHUTDOWN, or STOP events.
490 GUEST_PANICKED
491 --------------
493 Emitted when guest OS panic is detected.
495 Data:
497 - "action": Action that has been taken (json-string, currently always "pause").
499 Example:
501 { "event": "GUEST_PANICKED",
502      "data": { "action": "pause" } }