aboutsummaryrefslogtreecommitdiff
path: root/qapi/block-core.json
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2019-05-07 22:35:04 +0200
committerMax Reitz <mreitz@redhat.com>2019-06-14 14:16:57 +0200
commit16789db3de64147c7271d30a9d379b2a8aa2b81e (patch)
treeecdce5e2bfa45ee6da0dec8b9ebe27030bcd7149 /qapi/block-core.json
parent8eaac025fb43b16a38671e6b80e7059cd8af3403 (diff)
blkdebug: Add @iotype error option
This new error option allows users of blkdebug to inject errors only on certain kinds of I/O operations. Users usually want to make a very specific operation fail, not just any; but right now they simply hope that the event that triggers the error injection is followed up with that very operation. That may not be true, however, because the block layer is changing (including blkdebug, which may increase the number of types of I/O operations on which to inject errors). The new option's default has been chosen to keep backwards compatibility. Note that similar to the internal representation, we could choose to expose this option as a list of I/O types. But there is no practical use for this, because as described above, users usually know exactly which kind of operation they want to make fail, so there is no need to specify multiple I/O types at once. In addition, exposing this option as a list would require non-trivial changes to qemu_opts_absorb_qdict(). Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-id: 20190507203508.18026-4-mreitz@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'qapi/block-core.json')
-rw-r--r--qapi/block-core.json26
1 files changed, 26 insertions, 0 deletions
diff --git a/qapi/block-core.json b/qapi/block-core.json
index c0ff3a83ef..34617a2c7a 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -3265,6 +3265,26 @@
'cor_write', 'cluster_alloc_space'] }
##
+# @BlkdebugIOType:
+#
+# Kinds of I/O that blkdebug can inject errors in.
+#
+# @read: .bdrv_co_preadv()
+#
+# @write: .bdrv_co_pwritev()
+#
+# @write-zeroes: .bdrv_co_pwrite_zeroes()
+#
+# @discard: .bdrv_co_pdiscard()
+#
+# @flush: .bdrv_co_flush_to_disk()
+#
+# Since: 4.1
+##
+{ 'enum': 'BlkdebugIOType', 'prefix': 'BLKDEBUG_IO_TYPE',
+ 'data': [ 'read', 'write', 'write-zeroes', 'discard', 'flush' ] }
+
+##
# @BlkdebugInjectErrorOptions:
#
# Describes a single error injection for blkdebug.
@@ -3274,6 +3294,11 @@
# @state: the state identifier blkdebug needs to be in to
# actually trigger the event; defaults to "any"
#
+# @iotype: the type of I/O operations on which this error should
+# be injected; defaults to "all read, write,
+# write-zeroes, discard, and flush operations"
+# (since: 4.1)
+#
# @errno: error identifier (errno) to be returned; defaults to
# EIO
#
@@ -3291,6 +3316,7 @@
{ 'struct': 'BlkdebugInjectErrorOptions',
'data': { 'event': 'BlkdebugEvent',
'*state': 'int',
+ '*iotype': 'BlkdebugIOType',
'*errno': 'int',
'*sector': 'int',
'*once': 'bool',