summaryrefslogtreecommitdiffstats
path: root/block/blkdebug.c
diff options
context:
space:
mode:
authorPeter Maydell2017-10-27 10:29:05 +0200
committerPeter Maydell2017-10-27 10:29:06 +0200
commit46f63e5b8899e1639d93025a8f2d5f1239b7dcdd (patch)
tree3bc6a18077f9acd20f382f62608ee36ef7771394 /block/blkdebug.c
parentMerge remote-tracking branch 'remotes/rth/tags/pull-dis-20171026' into staging (diff)
parentMerge remote-tracking branch 'mreitz/tags/pull-block-2017-10-26' into queue-b... (diff)
downloadqemu-46f63e5b8899e1639d93025a8f2d5f1239b7dcdd.tar.gz
qemu-46f63e5b8899e1639d93025a8f2d5f1239b7dcdd.tar.xz
qemu-46f63e5b8899e1639d93025a8f2d5f1239b7dcdd.zip
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Block layer patches # gpg: Signature made Thu 26 Oct 2017 14:02:54 BST # gpg: using RSA key 0x7F09B272C88F2FD6 # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" # Primary key fingerprint: DC3D EB15 9A9A F95D 3D74 56FE 7F09 B272 C88F 2FD6 * remotes/kevin/tags/for-upstream: (35 commits) iotests: Add cluster_size=64k to 125 qcow2: Always execute preallocate() in a coroutine qcow2: Fix unaligned preallocated truncation qcow2: Emit errp when truncating the image tail iotests: Filter actual image size in 184 and 191 iotests: Pull _filter_actual_image_size from 67/87 iotests: Add test for dataplane mirroring qcow2: Use BDRV_SECTOR_BITS instead of its literal value qemu-img.1: Image invalidation on qemu-img commit qemu-io: Relax 'alloc' now that block-status doesn't assert qcow2: Reduce is_zero() rounding block: Reduce bdrv_aligned_preadv() rounding block: Align block status requests qemu-img: Change img_compare() to be byte-based qemu-img: Change img_rebase() to be byte-based qemu-img: Change compare_sectors() to be byte-based qemu-img: Change check_empty_sectors() to byte-based qemu-img: Drop redundant error message in compare qemu-img: Add find_nonzero() qemu-img: Speed up compare on pre-allocated larger file ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'block/blkdebug.c')
-rw-r--r--block/blkdebug.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/block/blkdebug.c b/block/blkdebug.c
index dfdf9b91aa..e21669979d 100644
--- a/block/blkdebug.c
+++ b/block/blkdebug.c
@@ -627,6 +627,17 @@ static int coroutine_fn blkdebug_co_pdiscard(BlockDriverState *bs,
return bdrv_co_pdiscard(bs->file->bs, offset, bytes);
}
+static int64_t coroutine_fn blkdebug_co_get_block_status(
+ BlockDriverState *bs, int64_t sector_num, int nb_sectors, int *pnum,
+ BlockDriverState **file)
+{
+ assert(QEMU_IS_ALIGNED(sector_num | nb_sectors,
+ DIV_ROUND_UP(bs->bl.request_alignment,
+ BDRV_SECTOR_SIZE)));
+ return bdrv_co_get_block_status_from_file(bs, sector_num, nb_sectors,
+ pnum, file);
+}
+
static void blkdebug_close(BlockDriverState *bs)
{
BDRVBlkdebugState *s = bs->opaque;
@@ -896,7 +907,7 @@ static BlockDriver bdrv_blkdebug = {
.bdrv_co_flush_to_disk = blkdebug_co_flush,
.bdrv_co_pwrite_zeroes = blkdebug_co_pwrite_zeroes,
.bdrv_co_pdiscard = blkdebug_co_pdiscard,
- .bdrv_co_get_block_status = bdrv_co_get_block_status_from_file,
+ .bdrv_co_get_block_status = blkdebug_co_get_block_status,
.bdrv_debug_event = blkdebug_debug_event,
.bdrv_debug_breakpoint = blkdebug_debug_breakpoint,