This event will be emitted when a disk operation takes longer than a
pre-defined threshold (as set on the block device).

Note that the description refers to the "delay-report-ns" and
"delay-stop-ns" block device properties, which are not yet available.
A future commit in this series will add them.

Signed-off-by: Hanna Czenczek <[email protected]>
---
 qapi/block.json | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/qapi/block.json b/qapi/block.json
index 8f4a71733c1..5f9f5c28050 100644
--- a/qapi/block.json
+++ b/qapi/block.json
@@ -649,3 +649,40 @@
 ##
 { 'enum': 'IoAccountingOperation',
   'data': [ 'read', 'write', 'flush', 'zone-append', 'unmap' ] }
+
+##
+# @BLOCK_IO_DELAY:
+#
+# Emitted when a disk operation takes longer than the pre-defined
+# threshold (as set via the "delay-report-ns" / "delay-stop-ns"
+# properties on the block device).
+#
+# Note that delays deliberately incurred by throttling do count
+# towards the operation duration.
+#
+# @qom-path: path to the block device object in the QOM tree
+#
+# @operation: I/O operation
+#
+# @latency-ns: Ongoing duration of the operation (in nanoseconds)
+#
+# @action: Action that has been taken ("report" for "delay-report-ns"
+#     or "stop" for "delay-stop-ns").  A "stop" action means the VM
+#     will be stopped with the "io-hang" `RunState`, which does not
+#     drain the block devices attached to the VM, because draining
+#     would be counterproductive in case of a hanging I/O request.
+#
+# @offset: Request offset in the guest disk (in bytes), if available
+#
+# @bytes: Request length
+#
+# Since: 11.2
+##
+{ 'event': 'BLOCK_IO_DELAY',
+  'data': {
+      'qom-path': 'str',
+      'operation': 'IoAccountingOperation',
+      'latency-ns': 'uint64',
+      'action': 'BlockErrorAction',
+      '*offset': 'uint64',
+      'bytes': 'uint64' } }
-- 
2.55.0


Reply via email to