[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 5/7] blkdebug: Inject errors on .bdrv_co_block_st
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PATCH v3 5/7] blkdebug: Inject errors on .bdrv_co_block_status() |
Date: |
Sat, 13 Apr 2019 18:53:41 +0200 |
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
qapi/block-core.json | 5 ++++-
block/blkdebug.c | 8 ++++++++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 717b13f7f5..2aa675a192 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -3252,10 +3252,13 @@
#
# @flush: .bdrv_co_flush_to_disk()
#
+# @block-status: .bdrv_co_block_status()
+#
# Since: 4.1
##
{ 'enum': 'BlkdebugIOType',
- 'data': [ 'read', 'write', 'write-zeroes', 'discard', 'flush' ] }
+ 'data': [ 'read', 'write', 'write-zeroes', 'discard', 'flush',
+ 'block-status' ] }
##
# @BlkdebugInjectErrorOptions:
diff --git a/block/blkdebug.c b/block/blkdebug.c
index 69c608be6f..df9c8b1673 100644
--- a/block/blkdebug.c
+++ b/block/blkdebug.c
@@ -670,7 +670,15 @@ static int coroutine_fn
blkdebug_co_block_status(BlockDriverState *bs,
int64_t *map,
BlockDriverState **file)
{
+ int err;
+
assert(QEMU_IS_ALIGNED(offset | bytes, bs->bl.request_alignment));
+
+ err = rule_check(bs, offset, bytes, BLKDEBUGIO_TYPE_BLOCK_STATUS);
+ if (err) {
+ return err;
+ }
+
return bdrv_co_block_status_from_file(bs, want_zero, offset, bytes,
pnum, map, file);
}
--
2.20.1
- [Qemu-devel] [PATCH v3 0/7] qemu-img: Add salvaging mode to convert, Max Reitz, 2019/04/13
- [Qemu-devel] [PATCH v3 1/7] qemu-img: Move quiet into ImgConvertState, Max Reitz, 2019/04/13
- [Qemu-devel] [PATCH v3 2/7] qemu-img: Add salvaging mode to convert, Max Reitz, 2019/04/13
- [Qemu-devel] [PATCH v3 3/7] blkdebug: Add @iotype error option, Max Reitz, 2019/04/13
- [Qemu-devel] [PATCH v3 4/7] blkdebug: Add "none" event, Max Reitz, 2019/04/13
- [Qemu-devel] [PATCH v3 5/7] blkdebug: Inject errors on .bdrv_co_block_status(),
Max Reitz <=
- [Qemu-devel] [PATCH v3 7/7] iotests: Test qemu-img convert -C --salvage, Max Reitz, 2019/04/13
- [Qemu-devel] [PATCH v3 6/7] iotests: Test qemu-img convert --salvage, Max Reitz, 2019/04/13