aboutsummaryrefslogtreecommitdiff
path: root/block/blkdebug.c
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2019-05-07 22:35:06 +0200
committerMax Reitz <mreitz@redhat.com>2019-06-14 14:16:57 +0200
commit1adb0b5e0f7c5c4f707b1ffa98e2b15ef51ebbc5 (patch)
tree5fba9e1cb1d55a7dd38e17d805a49b77b8549e23 /block/blkdebug.c
parentf8cec157cb7f04cb247786f8776ebfcebd9b61be (diff)
blkdebug: Inject errors on .bdrv_co_block_status()
Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-id: 20190507203508.18026-6-mreitz@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block/blkdebug.c')
-rw-r--r--block/blkdebug.c8
1 files changed, 8 insertions, 0 deletions
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);
}