block: Add "drained begin/end" for internal snapshot
[qemu/ar7.git] / docs / qmp-events.txt
blobd92cc4833b131b7b168ca77cd2876c5812ed60a8
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 MEM_UNPLUG_ERROR
236 --------------------
237 Emitted when memory hot unplug error occurs.
239 Data:
241 - "device": device name (json-string)
242 - "msg": Informative message (e.g., reason for the error) (json-string)
244 Example:
246 { "event": "MEM_UNPLUG_ERROR"
247   "data": { "device": "dimm1",
248             "msg": "acpi: device unplug for unsupported device"
249   },
250   "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
252 NIC_RX_FILTER_CHANGED
253 ---------------------
255 The event is emitted once until the query command is executed,
256 the first event will always be emitted.
258 Data:
260 - "name": net client name (json-string)
261 - "path": device path (json-string)
263 { "event": "NIC_RX_FILTER_CHANGED",
264   "data": { "name": "vnet0",
265             "path": "/machine/peripheral/vnet0/virtio-backend" },
266   "timestamp": { "seconds": 1368697518, "microseconds": 326866 } }
269 POWERDOWN
270 ---------
272 Emitted when the Virtual Machine is powered down through the power
273 control system, such as via ACPI.
275 Data: None.
277 Example:
279 { "event": "POWERDOWN",
280     "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
282 QUORUM_FAILURE
283 --------------
285 Emitted by the Quorum block driver if it fails to establish a quorum.
287 Data:
289 - "reference":     device name if defined else node name.
290 - "sector-num":    Number of the first sector of the failed read operation.
291 - "sectors-count": Failed read operation sector count.
293 Example:
295 { "event": "QUORUM_FAILURE",
296      "data": { "reference": "usr1", "sector-num": 345435, "sectors-count": 5 },
297      "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
299 QUORUM_REPORT_BAD
300 -----------------
302 Emitted to report a corruption of a Quorum file.
304 Data:
306 - "error":         Error message (json-string, optional)
307                    Only present on failure.  This field contains a human-readable
308                    error message.  There are no semantics other than that the
309                    block layer reported an error and clients should not try to
310                    interpret the error string.
311 - "node-name":     The graph node name of the block driver state.
312 - "sector-num":    Number of the first sector of the failed read operation.
313 - "sectors-count": Failed read operation sector count.
315 Example:
317 { "event": "QUORUM_REPORT_BAD",
318      "data": { "node-name": "1.raw", "sector-num": 345435, "sectors-count": 5 },
319      "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
321 RESET
322 -----
324 Emitted when the Virtual Machine is reset.
326 Data: None.
328 Example:
330 { "event": "RESET",
331     "timestamp": { "seconds": 1267041653, "microseconds": 9518 } }
333 RESUME
334 ------
336 Emitted when the Virtual Machine resumes execution.
338 Data: None.
340 Example:
342 { "event": "RESUME",
343     "timestamp": { "seconds": 1271770767, "microseconds": 582542 } }
345 RTC_CHANGE
346 ----------
348 Emitted when the guest changes the RTC time.
350 Data:
352 - "offset": Offset between base RTC clock (as specified by -rtc base), and
353 new RTC clock value (json-number)
355 Example:
357 { "event": "RTC_CHANGE",
358     "data": { "offset": 78 },
359     "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
361 SHUTDOWN
362 --------
364 Emitted when the Virtual Machine has shut down, indicating that qemu
365 is about to exit.
367 Data: None.
369 Example:
371 { "event": "SHUTDOWN",
372     "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
374 Note: If the command-line option "-no-shutdown" has been specified, a STOP
375 event will eventually follow the SHUTDOWN event.
377 SPICE_CONNECTED
378 ---------------
380 Emitted when a SPICE client connects.
382 Data:
384 - "server": Server information (json-object)
385   - "host": IP address (json-string)
386   - "port": port number (json-string)
387   - "family": address family (json-string, "ipv4" or "ipv6")
388 - "client": Client information (json-object)
389   - "host": IP address (json-string)
390   - "port": port number (json-string)
391   - "family": address family (json-string, "ipv4" or "ipv6")
393 Example:
395 { "timestamp": {"seconds": 1290688046, "microseconds": 388707},
396   "event": "SPICE_CONNECTED",
397   "data": {
398     "server": { "port": "5920", "family": "ipv4", "host": "127.0.0.1"},
399     "client": {"port": "52873", "family": "ipv4", "host": "127.0.0.1"}
402 SPICE_DISCONNECTED
403 ------------------
405 Emitted when a SPICE client disconnects.
407 Data:
409 - "server": Server information (json-object)
410   - "host": IP address (json-string)
411   - "port": port number (json-string)
412   - "family": address family (json-string, "ipv4" or "ipv6")
413 - "client": Client information (json-object)
414   - "host": IP address (json-string)
415   - "port": port number (json-string)
416   - "family": address family (json-string, "ipv4" or "ipv6")
418 Example:
420 { "timestamp": {"seconds": 1290688046, "microseconds": 388707},
421   "event": "SPICE_DISCONNECTED",
422   "data": {
423     "server": { "port": "5920", "family": "ipv4", "host": "127.0.0.1"},
424     "client": {"port": "52873", "family": "ipv4", "host": "127.0.0.1"}
427 SPICE_INITIALIZED
428 -----------------
430 Emitted after initial handshake and authentication takes place (if any)
431 and the SPICE channel is up and running
433 Data:
435 - "server": Server information (json-object)
436   - "host": IP address (json-string)
437   - "port": port number (json-string)
438   - "family": address family (json-string, "ipv4" or "ipv6")
439   - "auth": authentication method (json-string, optional)
440 - "client": Client information (json-object)
441   - "host": IP address (json-string)
442   - "port": port number (json-string)
443   - "family": address family (json-string, "ipv4" or "ipv6")
444   - "connection-id": spice connection id.  All channels with the same id
445                      belong to the same spice session (json-int)
446   - "channel-type": channel type.  "1" is the main control channel, filter for
447                     this one if you want track spice sessions only (json-int)
448   - "channel-id": channel id.  Usually "0", might be different needed when
449                   multiple channels of the same type exist, such as multiple
450                   display channels in a multihead setup (json-int)
451   - "tls": whevener the channel is encrypted (json-bool)
453 Example:
455 { "timestamp": {"seconds": 1290688046, "microseconds": 417172},
456   "event": "SPICE_INITIALIZED",
457   "data": {"server": {"auth": "spice", "port": "5921",
458                       "family": "ipv4", "host": "127.0.0.1"},
459            "client": {"port": "49004", "family": "ipv4", "channel-type": 3,
460                       "connection-id": 1804289383, "host": "127.0.0.1",
461                       "channel-id": 0, "tls": true}
464 SPICE_MIGRATE_COMPLETED
465 -----------------------
467 Emitted when SPICE migration has completed
469 Data: None.
471 Example:
473 { "timestamp": {"seconds": 1290688046, "microseconds": 417172},
474   "event": "SPICE_MIGRATE_COMPLETED" }
476 MIGRATION
477 ---------
479 Emitted when a migration event happens
481 Data: None.
483  - "status": migration status
484      See MigrationStatus in ~/qapi-schema.json for possible values
486 Example:
488 {"timestamp": {"seconds": 1432121972, "microseconds": 744001},
489  "event": "MIGRATION", "data": {"status": "completed"}}
491 STOP
492 ----
494 Emitted when the Virtual Machine is stopped.
496 Data: None.
498 Example:
500 { "event": "STOP",
501     "timestamp": { "seconds": 1267041730, "microseconds": 281295 } }
503 SUSPEND
504 -------
506 Emitted when guest enters S3 state.
508 Data: None.
510 Example:
512 { "event": "SUSPEND",
513      "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
515 SUSPEND_DISK
516 ------------
518 Emitted when the guest makes a request to enter S4 state.
520 Data: None.
522 Example:
524 { "event": "SUSPEND_DISK",
525      "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
527 Note: QEMU shuts down when entering S4 state.
529 VNC_CONNECTED
530 -------------
532 Emitted when a VNC client establishes a connection.
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")
546 Example:
548 { "event": "VNC_CONNECTED",
549     "data": {
550         "server": { "auth": "sasl", "family": "ipv4",
551                     "service": "5901", "host": "0.0.0.0" },
552         "client": { "family": "ipv4", "service": "58425",
553                     "host": "127.0.0.1" } },
554     "timestamp": { "seconds": 1262976601, "microseconds": 975795 } }
557 Note: This event is emitted before any authentication takes place, thus
558 the authentication ID is not provided.
560 VNC_DISCONNECTED
561 ----------------
563 Emitted when the connection is closed.
565 Data:
567 - "server": Server information (json-object)
568   - "host": IP address (json-string)
569   - "service": port number (json-string)
570   - "family": address family (json-string, "ipv4" or "ipv6")
571   - "auth": authentication method (json-string, optional)
572 - "client": Client information (json-object)
573   - "host": IP address (json-string)
574   - "service": port number (json-string)
575   - "family": address family (json-string, "ipv4" or "ipv6")
576   - "x509_dname": TLS dname (json-string, optional)
577   - "sasl_username": SASL username (json-string, optional)
579 Example:
581 { "event": "VNC_DISCONNECTED",
582     "data": {
583         "server": { "auth": "sasl", "family": "ipv4",
584                     "service": "5901", "host": "0.0.0.0" },
585         "client": { "family": "ipv4", "service": "58425",
586                     "host": "127.0.0.1", "sasl_username": "luiz" } },
587     "timestamp": { "seconds": 1262976601, "microseconds": 975795 } }
589 VNC_INITIALIZED
590 ---------------
592 Emitted after authentication takes place (if any) and the VNC session is
593 made active.
595 Data:
597 - "server": Server information (json-object)
598   - "host": IP address (json-string)
599   - "service": port number (json-string)
600   - "family": address family (json-string, "ipv4" or "ipv6")
601   - "auth": authentication method (json-string, optional)
602 - "client": Client information (json-object)
603   - "host": IP address (json-string)
604   - "service": port number (json-string)
605   - "family": address family (json-string, "ipv4" or "ipv6")
606   - "x509_dname": TLS dname (json-string, optional)
607   - "sasl_username": SASL username (json-string, optional)
609 Example:
611 { "event": "VNC_INITIALIZED",
612     "data": {
613         "server": { "auth": "sasl", "family": "ipv4",
614                     "service": "5901", "host": "0.0.0.0"},
615         "client": { "family": "ipv4", "service": "46089",
616                     "host": "127.0.0.1", "sasl_username": "luiz" } },
617         "timestamp": { "seconds": 1263475302, "microseconds": 150772 } }
619 VSERPORT_CHANGE
620 ---------------
622 Emitted when the guest opens or closes a virtio-serial port.
624 Data:
626 - "id": device identifier of the virtio-serial port (json-string)
627 - "open": true if the guest has opened the virtio-serial port (json-bool)
629 Example:
631 { "event": "VSERPORT_CHANGE",
632     "data": { "id": "channel0", "open": true },
633     "timestamp": { "seconds": 1401385907, "microseconds": 422329 } }
635 WAKEUP
636 ------
638 Emitted when the guest has woken up from S3 and is running.
640 Data: None.
642 Example:
644 { "event": "WAKEUP",
645      "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
647 WATCHDOG
648 --------
650 Emitted when the watchdog device's timer is expired.
652 Data:
654 - "action": Action that has been taken, it's one of the following (json-string):
655             "reset", "shutdown", "poweroff", "pause", "debug", or "none"
657 Example:
659 { "event": "WATCHDOG",
660      "data": { "action": "reset" },
661      "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
663 Note: If action is "reset", "shutdown", or "pause" the WATCHDOG event is
664 followed respectively by the RESET, SHUTDOWN, or STOP events.