aboutsummaryrefslogtreecommitdiff
path: root/block/blkdebug.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2017-07-10 14:06:49 +0100
committerPeter Maydell <peter.maydell@linaro.org>2017-07-10 14:06:49 +0100
commit94c56652b9079cfb9d560a6dde7ecb15eb9ef9c7 (patch)
treeea8f03ede61758005216393d7605c0666e13f787 /block/blkdebug.c
parent6580476a14ae0db300733d8b9991fd937cf5e703 (diff)
parent51b0a488882328f8f02519bb47ca7e0e7fbe12ff (diff)
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Block layer patches # gpg: Signature made Mon 10 Jul 2017 12:26:44 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: (40 commits) block: Make bdrv_is_allocated_above() byte-based block: Minimize raw use of bds->total_sectors block: Make bdrv_is_allocated() byte-based backup: Switch backup_run() to byte-based backup: Switch backup_do_cow() to byte-based backup: Switch block_backup.h to byte-based backup: Switch BackupBlockJob to byte-based block: Drop unused bdrv_round_sectors_to_clusters() mirror: Switch mirror_iteration() to byte-based mirror: Switch mirror_do_read() to byte-based mirror: Switch mirror_cow_align() to byte-based mirror: Update signature of mirror_clip_sectors() mirror: Switch mirror_do_zero_or_discard() to byte-based mirror: Switch MirrorBlockJob to byte-based commit: Switch commit_run() to byte-based commit: Switch commit_populate() to byte-based stream: Switch stream_run() to byte-based stream: Drop reached_end for stream_complete() stream: Switch stream_populate() to byte-based trace: Show blockjob actions via bytes, not sectors ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'block/blkdebug.c')
-rw-r--r--block/blkdebug.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/block/blkdebug.c b/block/blkdebug.c
index a1b24b9b0d..b25856c49c 100644
--- a/block/blkdebug.c
+++ b/block/blkdebug.c
@@ -641,6 +641,16 @@ 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)
+{
+ *pnum = nb_sectors;
+ *file = bs->file->bs;
+ return BDRV_BLOCK_RAW | BDRV_BLOCK_OFFSET_VALID |
+ (sector_num << BDRV_SECTOR_BITS);
+}
+
static void blkdebug_close(BlockDriverState *bs)
{
BDRVBlkdebugState *s = bs->opaque;
@@ -915,6 +925,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 = blkdebug_co_get_block_status,
.bdrv_debug_event = blkdebug_debug_event,
.bdrv_debug_breakpoint = blkdebug_debug_breakpoint,