Signed-off-by: Devin Nakamura <devin...@gmail.com> --- block.c | 15 +++++++++++++++ block.h | 2 ++ 2 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/block.c b/block.c index 5ca396b..ed62c4a 100644 --- a/block.c +++ b/block.c @@ -3320,3 +3320,18 @@ int bdrv_get_conversion_options(BlockDriverState *bs, } return bs->drv->bdrv_get_conversion_options(bs, options); } + + +int bdrv_get_mapping(BlockDriverState *bs, uint64_t guest_offset, + uint64_t *host_offset, uint64_t *contiguous_bytes) +{ + BlockDriver *drv = bs->drv; + if (!drv) { + return -ENOMEDIUM; + } + if (!drv->bdrv_get_mapping) { + return -ENOTSUP; + } + return drv->bdrv_get_mapping(bs, guest_offset, host_offset, + contiguous_bytes); +} diff --git a/block.h b/block.h index 77e3135..c983d50 100644 --- a/block.h +++ b/block.h @@ -264,6 +264,8 @@ int bdrv_open_conversion_target(BlockDriverState **bs, BlockDriverState *file, QEMUOptionParameter *usr_options, const char *target_fmt, bool force); +int bdrv_get_mapping(BlockDriverState *bs, uint64_t guest_offset, + uint64_t *host_offset, uint64_t *contiguous_bytes); typedef enum { BLKDBG_L1_UPDATE, -- 1.7.6.rc1