[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 18/20] blkdebug: Inject errors on .bdrv_co_block_stat
From: |
Max Reitz |
Subject: |
[Qemu-block] [PULL 18/20] blkdebug: Inject errors on .bdrv_co_block_status() |
Date: |
Fri, 14 Jun 2019 15:40:19 +0200 |
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <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 60f903afa3..61124431d8 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -3281,10 +3281,13 @@
#
# @flush: .bdrv_co_flush_to_disk()
#
+# @block-status: .bdrv_co_block_status()
+#
# Since: 4.1
##
{ 'enum': 'BlkdebugIOType', 'prefix': 'BLKDEBUG_IO_TYPE',
- '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 1663ed25af..5ae96c52b0 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, BLKDEBUG_IO_TYPE_BLOCK_STATUS);
+ if (err) {
+ return err;
+ }
+
return bdrv_co_block_status_from_file(bs, want_zero, offset, bytes,
pnum, map, file);
}
--
2.21.0
- [Qemu-block] [PULL 03/20] QEMUMachine: add events_wait method, (continued)
- [Qemu-block] [PULL 03/20] QEMUMachine: add events_wait method, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 05/20] iotests: add iotest 256 for testing blockdev-backup across iothread contexts, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 09/20] hw/block/fdc: floppy command FIFO memory initialization, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 10/20] iotests: restrict 254 to support only qcow2, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 12/20] qapi/block-core: Overlays are not snapshots, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 11/20] qemu-img: Fix options leakage in img_rebase(), Max Reitz, 2019/06/14
- [Qemu-block] [PULL 14/20] qemu-img: Move quiet into ImgConvertState, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 13/20] blockdev: Overlays are not snapshots, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 15/20] qemu-img: Add salvaging mode to convert, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 16/20] blkdebug: Add @iotype error option, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 18/20] blkdebug: Inject errors on .bdrv_co_block_status(),
Max Reitz <=
- [Qemu-block] [PULL 17/20] blkdebug: Add "none" event, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 19/20] iotests: Test qemu-img convert --salvage, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 20/20] iotests: Test qemu-img convert -C --salvage, Max Reitz, 2019/06/14
- Re: [Qemu-block] [PULL 00/20] Block patches, Peter Maydell, 2019/06/14