]> git.proxmox.com Git - mirror_qemu.git/blob - docs/qmp-events.txt
virtio: decrement vq->inuse in virtqueue_discard()
[mirror_qemu.git] / docs / qmp-events.txt
1 QEMU Machine Protocol Events
2 ============================
3
4 ACPI_DEVICE_OST
5 ---------------
6
7 Emitted when guest executes ACPI _OST method.
8
9 - data: ACPIOSTInfo type as described in qapi-schema.json
10
11 { "event": "ACPI_DEVICE_OST",
12 "data": { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0 } }
13
14 BALLOON_CHANGE
15 --------------
16
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
20
21 Data:
22
23 - "actual": actual level of the guest memory balloon in bytes (json-number)
24
25 Example:
26
27 { "event": "BALLOON_CHANGE",
28 "data": { "actual": 944766976 },
29 "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
30
31 Note: this event is rate-limited.
32
33 BLOCK_IMAGE_CORRUPTED
34 ---------------------
35
36 Emitted when a disk image is being marked corrupt. The image can be
37 identified by its device or node name. The 'device' field is always
38 present for compatibility reasons, but it can be empty ("") if the
39 image does not have a device name associated.
40
41 Data:
42
43 - "device": Device name (json-string)
44 - "node-name": Node name (json-string, optional)
45 - "msg": Informative message (e.g., reason for the corruption)
46 (json-string)
47 - "offset": If the corruption resulted from an image access, this
48 is the host's access offset into the image
49 (json-int, optional)
50 - "size": If the corruption resulted from an image access, this
51 is the access size (json-int, optional)
52
53 Example:
54
55 { "event": "BLOCK_IMAGE_CORRUPTED",
56 "data": { "device": "ide0-hd0", "node-name": "node0",
57 "msg": "Prevented active L1 table overwrite", "offset": 196608,
58 "size": 65536 },
59 "timestamp": { "seconds": 1378126126, "microseconds": 966463 } }
60
61 BLOCK_IO_ERROR
62 --------------
63
64 Emitted when a disk I/O error occurs.
65
66 Data:
67
68 - "device": device name (json-string)
69 - "operation": I/O operation (json-string, "read" or "write")
70 - "action": action that has been taken, it's one of the following (json-string):
71 "ignore": error has been ignored
72 "report": error has been reported to the device
73 "stop": the VM is going to stop because of the error
74
75 Example:
76
77 { "event": "BLOCK_IO_ERROR",
78 "data": { "device": "ide0-hd1",
79 "operation": "write",
80 "action": "stop" },
81 "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
82
83 Note: If action is "stop", a STOP event will eventually follow the
84 BLOCK_IO_ERROR event.
85
86 BLOCK_JOB_CANCELLED
87 -------------------
88
89 Emitted when a block job has been cancelled.
90
91 Data:
92
93 - "type": Job type (json-string; "stream" for image streaming
94 "commit" for block commit)
95 - "device": Job identifier. Originally the device name but other
96 values are allowed since QEMU 2.7 (json-string)
97 - "len": Maximum progress value (json-int)
98 - "offset": Current progress value (json-int)
99 On success this is equal to len.
100 On failure this is less than len.
101 - "speed": Rate limit, bytes per second (json-int)
102
103 Example:
104
105 { "event": "BLOCK_JOB_CANCELLED",
106 "data": { "type": "stream", "device": "virtio-disk0",
107 "len": 10737418240, "offset": 134217728,
108 "speed": 0 },
109 "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
110
111 BLOCK_JOB_COMPLETED
112 -------------------
113
114 Emitted when a block job has completed.
115
116 Data:
117
118 - "type": Job type (json-string; "stream" for image streaming
119 "commit" for block commit)
120 - "device": Job identifier. Originally the device name but other
121 values are allowed since QEMU 2.7 (json-string)
122 - "len": Maximum progress value (json-int)
123 - "offset": Current progress value (json-int)
124 On success this is equal to len.
125 On failure this is less than len.
126 - "speed": Rate limit, bytes per second (json-int)
127 - "error": Error message (json-string, optional)
128 Only present on failure. This field contains a human-readable
129 error message. There are no semantics other than that streaming
130 has failed and clients should not try to interpret the error
131 string.
132
133 Example:
134
135 { "event": "BLOCK_JOB_COMPLETED",
136 "data": { "type": "stream", "device": "virtio-disk0",
137 "len": 10737418240, "offset": 10737418240,
138 "speed": 0 },
139 "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
140
141 BLOCK_JOB_ERROR
142 ---------------
143
144 Emitted when a block job encounters an error.
145
146 Data:
147
148 - "device": Job identifier. Originally the device name but other
149 values are allowed since QEMU 2.7 (json-string)
150 - "operation": I/O operation (json-string, "read" or "write")
151 - "action": action that has been taken, it's one of the following (json-string):
152 "ignore": error has been ignored, the job may fail later
153 "report": error will be reported and the job canceled
154 "stop": error caused job to be paused
155
156 Example:
157
158 { "event": "BLOCK_JOB_ERROR",
159 "data": { "device": "ide0-hd1",
160 "operation": "write",
161 "action": "stop" },
162 "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
163
164 BLOCK_JOB_READY
165 ---------------
166
167 Emitted when a block job is ready to complete.
168
169 Data:
170
171 - "type": Job type (json-string; "stream" for image streaming
172 "commit" for block commit)
173 - "device": Job identifier. Originally the device name but other
174 values are allowed since QEMU 2.7 (json-string)
175 - "len": Maximum progress value (json-int)
176 - "offset": Current progress value (json-int)
177 On success this is equal to len.
178 On failure this is less than len.
179 - "speed": Rate limit, bytes per second (json-int)
180
181 Example:
182
183 { "event": "BLOCK_JOB_READY",
184 "data": { "device": "drive0", "type": "mirror", "speed": 0,
185 "len": 2097152, "offset": 2097152 }
186 "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
187
188 Note: The "ready to complete" status is always reset by a BLOCK_JOB_ERROR
189 event.
190
191 DEVICE_DELETED
192 --------------
193
194 Emitted whenever the device removal completion is acknowledged
195 by the guest.
196 At this point, it's safe to reuse the specified device ID.
197 Device removal can be initiated by the guest or by HMP/QMP commands.
198
199 Data:
200
201 - "device": device name (json-string, optional)
202 - "path": device path (json-string)
203
204 { "event": "DEVICE_DELETED",
205 "data": { "device": "virtio-net-pci-0",
206 "path": "/machine/peripheral/virtio-net-pci-0" },
207 "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
208
209 DEVICE_TRAY_MOVED
210 -----------------
211
212 It's emitted whenever the tray of a removable device is moved by the guest
213 or by HMP/QMP commands.
214
215 Data:
216
217 - "device": device name (json-string)
218 - "tray-open": true if the tray has been opened or false if it has been closed
219 (json-bool)
220
221 { "event": "DEVICE_TRAY_MOVED",
222 "data": { "device": "ide1-cd0",
223 "tray-open": true
224 },
225 "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
226
227 DUMP_COMPLETED
228 --------------
229
230 Emitted when the guest has finished one memory dump.
231
232 Data:
233
234 - "result": DumpQueryResult type described in qapi-schema.json
235 - "error": Error message when dump failed. This is only a
236 human-readable string provided when dump failed. It should not be
237 parsed in any way (json-string, optional)
238
239 Example:
240
241 { "event": "DUMP_COMPLETED",
242 "data": {"result": {"total": 1090650112, "status": "completed",
243 "completed": 1090650112} } }
244
245 GUEST_PANICKED
246 --------------
247
248 Emitted when guest OS panic is detected.
249
250 Data:
251
252 - "action": Action that has been taken (json-string, currently always "pause").
253
254 Example:
255
256 { "event": "GUEST_PANICKED",
257 "data": { "action": "pause" } }
258
259 MEM_UNPLUG_ERROR
260 --------------------
261 Emitted when memory hot unplug error occurs.
262
263 Data:
264
265 - "device": device name (json-string)
266 - "msg": Informative message (e.g., reason for the error) (json-string)
267
268 Example:
269
270 { "event": "MEM_UNPLUG_ERROR"
271 "data": { "device": "dimm1",
272 "msg": "acpi: device unplug for unsupported device"
273 },
274 "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
275
276 NIC_RX_FILTER_CHANGED
277 ---------------------
278
279 The event is emitted once until the query command is executed,
280 the first event will always be emitted.
281
282 Data:
283
284 - "name": net client name (json-string)
285 - "path": device path (json-string)
286
287 { "event": "NIC_RX_FILTER_CHANGED",
288 "data": { "name": "vnet0",
289 "path": "/machine/peripheral/vnet0/virtio-backend" },
290 "timestamp": { "seconds": 1368697518, "microseconds": 326866 } }
291 }
292
293 POWERDOWN
294 ---------
295
296 Emitted when the Virtual Machine is powered down through the power
297 control system, such as via ACPI.
298
299 Data: None.
300
301 Example:
302
303 { "event": "POWERDOWN",
304 "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
305
306 QUORUM_FAILURE
307 --------------
308
309 Emitted by the Quorum block driver if it fails to establish a quorum.
310
311 Data:
312
313 - "reference": device name if defined else node name.
314 - "sector-num": Number of the first sector of the failed read operation.
315 - "sectors-count": Failed read operation sector count.
316
317 Example:
318
319 { "event": "QUORUM_FAILURE",
320 "data": { "reference": "usr1", "sector-num": 345435, "sectors-count": 5 },
321 "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
322
323 Note: this event is rate-limited.
324
325 QUORUM_REPORT_BAD
326 -----------------
327
328 Emitted to report a corruption of a Quorum file.
329
330 Data:
331
332 - "type": Quorum operation type
333 - "error": Error message (json-string, optional)
334 Only present on failure. This field contains a human-readable
335 error message. There are no semantics other than that the
336 block layer reported an error and clients should not try to
337 interpret the error string.
338 - "node-name": The graph node name of the block driver state.
339 - "sector-num": Number of the first sector of the failed read operation.
340 - "sectors-count": Failed read operation sector count.
341
342 Example:
343
344 Read operation:
345 { "event": "QUORUM_REPORT_BAD",
346 "data": { "node-name": "node0", "sector-num": 345435, "sectors-count": 5,
347 "type": "read" },
348 "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
349
350 Flush operation:
351 { "event": "QUORUM_REPORT_BAD",
352 "data": { "node-name": "node0", "sector-num": 0, "sectors-count": 2097120,
353 "type": "flush", "error": "Broken pipe" },
354 "timestamp": { "seconds": 1456406829, "microseconds": 291763 } }
355
356 Note: this event is rate-limited.
357
358 RESET
359 -----
360
361 Emitted when the Virtual Machine is reset.
362
363 Data: None.
364
365 Example:
366
367 { "event": "RESET",
368 "timestamp": { "seconds": 1267041653, "microseconds": 9518 } }
369
370 RESUME
371 ------
372
373 Emitted when the Virtual Machine resumes execution.
374
375 Data: None.
376
377 Example:
378
379 { "event": "RESUME",
380 "timestamp": { "seconds": 1271770767, "microseconds": 582542 } }
381
382 RTC_CHANGE
383 ----------
384
385 Emitted when the guest changes the RTC time.
386
387 Data:
388
389 - "offset": Offset between base RTC clock (as specified by -rtc base), and
390 new RTC clock value (json-number)
391
392 Example:
393
394 { "event": "RTC_CHANGE",
395 "data": { "offset": 78 },
396 "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
397
398 Note: this event is rate-limited.
399
400 SHUTDOWN
401 --------
402
403 Emitted when the Virtual Machine has shut down, indicating that qemu
404 is about to exit.
405
406 Data: None.
407
408 Example:
409
410 { "event": "SHUTDOWN",
411 "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }
412
413 Note: If the command-line option "-no-shutdown" has been specified, a STOP
414 event will eventually follow the SHUTDOWN event.
415
416 SPICE_CONNECTED
417 ---------------
418
419 Emitted when a SPICE client connects.
420
421 Data:
422
423 - "server": Server 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 - "client": Client information (json-object)
428 - "host": IP address (json-string)
429 - "port": port number (json-string)
430 - "family": address family (json-string, "ipv4" or "ipv6")
431
432 Example:
433
434 { "timestamp": {"seconds": 1290688046, "microseconds": 388707},
435 "event": "SPICE_CONNECTED",
436 "data": {
437 "server": { "port": "5920", "family": "ipv4", "host": "127.0.0.1"},
438 "client": {"port": "52873", "family": "ipv4", "host": "127.0.0.1"}
439 }}
440
441 SPICE_DISCONNECTED
442 ------------------
443
444 Emitted when a SPICE client disconnects.
445
446 Data:
447
448 - "server": Server information (json-object)
449 - "host": IP address (json-string)
450 - "port": port number (json-string)
451 - "family": address family (json-string, "ipv4" or "ipv6")
452 - "client": Client information (json-object)
453 - "host": IP address (json-string)
454 - "port": port number (json-string)
455 - "family": address family (json-string, "ipv4" or "ipv6")
456
457 Example:
458
459 { "timestamp": {"seconds": 1290688046, "microseconds": 388707},
460 "event": "SPICE_DISCONNECTED",
461 "data": {
462 "server": { "port": "5920", "family": "ipv4", "host": "127.0.0.1"},
463 "client": {"port": "52873", "family": "ipv4", "host": "127.0.0.1"}
464 }}
465
466 SPICE_INITIALIZED
467 -----------------
468
469 Emitted after initial handshake and authentication takes place (if any)
470 and the SPICE channel is up and running
471
472 Data:
473
474 - "server": Server information (json-object)
475 - "host": IP address (json-string)
476 - "port": port number (json-string)
477 - "family": address family (json-string, "ipv4" or "ipv6")
478 - "auth": authentication method (json-string, optional)
479 - "client": Client information (json-object)
480 - "host": IP address (json-string)
481 - "port": port number (json-string)
482 - "family": address family (json-string, "ipv4" or "ipv6")
483 - "connection-id": spice connection id. All channels with the same id
484 belong to the same spice session (json-int)
485 - "channel-type": channel type. "1" is the main control channel, filter for
486 this one if you want track spice sessions only (json-int)
487 - "channel-id": channel id. Usually "0", might be different needed when
488 multiple channels of the same type exist, such as multiple
489 display channels in a multihead setup (json-int)
490 - "tls": whevener the channel is encrypted (json-bool)
491
492 Example:
493
494 { "timestamp": {"seconds": 1290688046, "microseconds": 417172},
495 "event": "SPICE_INITIALIZED",
496 "data": {"server": {"auth": "spice", "port": "5921",
497 "family": "ipv4", "host": "127.0.0.1"},
498 "client": {"port": "49004", "family": "ipv4", "channel-type": 3,
499 "connection-id": 1804289383, "host": "127.0.0.1",
500 "channel-id": 0, "tls": true}
501 }}
502
503 SPICE_MIGRATE_COMPLETED
504 -----------------------
505
506 Emitted when SPICE migration has completed
507
508 Data: None.
509
510 Example:
511
512 { "timestamp": {"seconds": 1290688046, "microseconds": 417172},
513 "event": "SPICE_MIGRATE_COMPLETED" }
514
515 MIGRATION
516 ---------
517
518 Emitted when a migration event happens
519
520 Data: None.
521
522 - "status": migration status
523 See MigrationStatus in ~/qapi-schema.json for possible values
524
525 Example:
526
527 {"timestamp": {"seconds": 1432121972, "microseconds": 744001},
528 "event": "MIGRATION", "data": {"status": "completed"}}
529
530 MIGRATION_PASS
531 --------------
532
533 Emitted from the source side of a migration at the start of each pass
534 (when it syncs the dirty bitmap)
535
536 Data: None.
537
538 - "pass": An incrementing count (starting at 1 on the first pass)
539
540 Example:
541 {"timestamp": {"seconds": 1449669631, "microseconds": 239225},
542 "event": "MIGRATION_PASS", "data": {"pass": 2}}
543
544 STOP
545 ----
546
547 Emitted when the Virtual Machine is stopped.
548
549 Data: None.
550
551 Example:
552
553 { "event": "STOP",
554 "timestamp": { "seconds": 1267041730, "microseconds": 281295 } }
555
556 SUSPEND
557 -------
558
559 Emitted when guest enters S3 state.
560
561 Data: None.
562
563 Example:
564
565 { "event": "SUSPEND",
566 "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
567
568 SUSPEND_DISK
569 ------------
570
571 Emitted when the guest makes a request to enter S4 state.
572
573 Data: None.
574
575 Example:
576
577 { "event": "SUSPEND_DISK",
578 "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
579
580 Note: QEMU shuts down when entering S4 state.
581
582 VNC_CONNECTED
583 -------------
584
585 Emitted when a VNC client establishes a connection.
586
587 Data:
588
589 - "server": Server information (json-object)
590 - "host": IP address (json-string)
591 - "service": port number (json-string)
592 - "family": address family (json-string, "ipv4" or "ipv6")
593 - "auth": authentication method (json-string, optional)
594 - "client": Client information (json-object)
595 - "host": IP address (json-string)
596 - "service": port number (json-string)
597 - "family": address family (json-string, "ipv4" or "ipv6")
598
599 Example:
600
601 { "event": "VNC_CONNECTED",
602 "data": {
603 "server": { "auth": "sasl", "family": "ipv4",
604 "service": "5901", "host": "0.0.0.0" },
605 "client": { "family": "ipv4", "service": "58425",
606 "host": "127.0.0.1" } },
607 "timestamp": { "seconds": 1262976601, "microseconds": 975795 } }
608
609
610 Note: This event is emitted before any authentication takes place, thus
611 the authentication ID is not provided.
612
613 VNC_DISCONNECTED
614 ----------------
615
616 Emitted when the connection is closed.
617
618 Data:
619
620 - "server": Server information (json-object)
621 - "host": IP address (json-string)
622 - "service": port number (json-string)
623 - "family": address family (json-string, "ipv4" or "ipv6")
624 - "auth": authentication method (json-string, optional)
625 - "client": Client information (json-object)
626 - "host": IP address (json-string)
627 - "service": port number (json-string)
628 - "family": address family (json-string, "ipv4" or "ipv6")
629 - "x509_dname": TLS dname (json-string, optional)
630 - "sasl_username": SASL username (json-string, optional)
631
632 Example:
633
634 { "event": "VNC_DISCONNECTED",
635 "data": {
636 "server": { "auth": "sasl", "family": "ipv4",
637 "service": "5901", "host": "0.0.0.0" },
638 "client": { "family": "ipv4", "service": "58425",
639 "host": "127.0.0.1", "sasl_username": "luiz" } },
640 "timestamp": { "seconds": 1262976601, "microseconds": 975795 } }
641
642 VNC_INITIALIZED
643 ---------------
644
645 Emitted after authentication takes place (if any) and the VNC session is
646 made active.
647
648 Data:
649
650 - "server": Server information (json-object)
651 - "host": IP address (json-string)
652 - "service": port number (json-string)
653 - "family": address family (json-string, "ipv4" or "ipv6")
654 - "auth": authentication method (json-string, optional)
655 - "client": Client information (json-object)
656 - "host": IP address (json-string)
657 - "service": port number (json-string)
658 - "family": address family (json-string, "ipv4" or "ipv6")
659 - "x509_dname": TLS dname (json-string, optional)
660 - "sasl_username": SASL username (json-string, optional)
661
662 Example:
663
664 { "event": "VNC_INITIALIZED",
665 "data": {
666 "server": { "auth": "sasl", "family": "ipv4",
667 "service": "5901", "host": "0.0.0.0"},
668 "client": { "family": "ipv4", "service": "46089",
669 "host": "127.0.0.1", "sasl_username": "luiz" } },
670 "timestamp": { "seconds": 1263475302, "microseconds": 150772 } }
671
672 VSERPORT_CHANGE
673 ---------------
674
675 Emitted when the guest opens or closes a virtio-serial port.
676
677 Data:
678
679 - "id": device identifier of the virtio-serial port (json-string)
680 - "open": true if the guest has opened the virtio-serial port (json-bool)
681
682 Example:
683
684 { "event": "VSERPORT_CHANGE",
685 "data": { "id": "channel0", "open": true },
686 "timestamp": { "seconds": 1401385907, "microseconds": 422329 } }
687
688 Note: this event is rate-limited separately for each "id".
689
690 WAKEUP
691 ------
692
693 Emitted when the guest has woken up from S3 and is running.
694
695 Data: None.
696
697 Example:
698
699 { "event": "WAKEUP",
700 "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
701
702 WATCHDOG
703 --------
704
705 Emitted when the watchdog device's timer is expired.
706
707 Data:
708
709 - "action": Action that has been taken, it's one of the following (json-string):
710 "reset", "shutdown", "poweroff", "pause", "debug", or "none"
711
712 Example:
713
714 { "event": "WATCHDOG",
715 "data": { "action": "reset" },
716 "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
717
718 Note: If action is "reset", "shutdown", or "pause" the WATCHDOG event is
719 followed respectively by the RESET, SHUTDOWN, or STOP events.
720
721 Note: this event is rate-limited.