Signed-off-by: Devin Nakamura <devin...@gmail.com> --- block.c | 12 ++++++++++++ block.h | 2 ++ 2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/block.c b/block.c index e7699a6..302b0d5 100644 --- a/block.c +++ b/block.c @@ -3037,3 +3037,15 @@ int bdrv_open_conversion_target(BlockDriverState **bs, (*bs)->opaque = qemu_malloc(drv->instance_size); return drv->bdrv_open_conversion_target(*bs, filename, 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 da87afb..8207389 100644 --- a/block.h +++ b/block.h @@ -252,6 +252,8 @@ int bdrv_in_use(BlockDriverState *bs); int bdrv_open_conversion_target(BlockDriverState **bs, char *filename, char *target_fmt, QEMUOptionParameter *options); +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