修订版 | 1adb0b5e0f7c5c4f707b1ffa98e2b15ef51ebbc5 (tree) |
---|---|
时间 | 2019-06-14 21:16:57 |
作者 | Max Reitz <mreitz@redh...> |
Commiter | Max Reitz |
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>
@@ -670,7 +670,15 @@ static int coroutine_fn blkdebug_co_block_status(BlockDriverState *bs, | ||
670 | 670 | int64_t *map, |
671 | 671 | BlockDriverState **file) |
672 | 672 | { |
673 | + int err; | |
674 | + | |
673 | 675 | assert(QEMU_IS_ALIGNED(offset | bytes, bs->bl.request_alignment)); |
676 | + | |
677 | + err = rule_check(bs, offset, bytes, BLKDEBUG_IO_TYPE_BLOCK_STATUS); | |
678 | + if (err) { | |
679 | + return err; | |
680 | + } | |
681 | + | |
674 | 682 | return bdrv_co_block_status_from_file(bs, want_zero, offset, bytes, |
675 | 683 | pnum, map, file); |
676 | 684 | } |
@@ -3281,10 +3281,13 @@ | ||
3281 | 3281 | # |
3282 | 3282 | # @flush: .bdrv_co_flush_to_disk() |
3283 | 3283 | # |
3284 | +# @block-status: .bdrv_co_block_status() | |
3285 | +# | |
3284 | 3286 | # Since: 4.1 |
3285 | 3287 | ## |
3286 | 3288 | { 'enum': 'BlkdebugIOType', 'prefix': 'BLKDEBUG_IO_TYPE', |
3287 | - 'data': [ 'read', 'write', 'write-zeroes', 'discard', 'flush' ] } | |
3289 | + 'data': [ 'read', 'write', 'write-zeroes', 'discard', 'flush', | |
3290 | + 'block-status' ] } | |
3288 | 3291 | |
3289 | 3292 | ## |
3290 | 3293 | # @BlkdebugInjectErrorOptions: |