From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:44993) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QgMXV-00030d-Nb for qemu-devel@nongnu.org; Mon, 11 Jul 2011 15:53:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QgMXP-00078I-I7 for qemu-devel@nongnu.org; Mon, 11 Jul 2011 15:53:08 -0400 Received: from mail-ew0-f45.google.com ([209.85.215.45]:42755) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QgMXP-00077d-2i for qemu-devel@nongnu.org; Mon, 11 Jul 2011 15:53:03 -0400 Received: by ewy24 with SMTP id 24so1655125ewy.4 for ; Mon, 11 Jul 2011 12:53:00 -0700 (PDT) From: Devin Nakamura Date: Mon, 11 Jul 2011 15:52:44 -0400 Message-Id: <1310413964-4294-1-git-send-email-devin122@gmail.com> In-Reply-To: <1309840884-32409-4-git-send-email-devin122@gmail.com> References: <1309840884-32409-4-git-send-email-devin122@gmail.com> Subject: [Qemu-devel] [PATCH v2 4/5] block: add bdrv_map() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, Devin Nakamura Signed-off-by: Devin Nakamura --- block.c | 14 ++++++++++++++ block.h | 2 ++ 2 files changed, 16 insertions(+), 0 deletions(-) diff --git a/block.c b/block.c index 3874ed5..39510cb 100644 --- a/block.c +++ b/block.c @@ -3051,3 +3051,17 @@ int bdrv_get_mapping(BlockDriverState *bs, uint64_t *guest_offset, return drv->bdrv_get_mapping(bs, guest_offset, host_offset, contiguous_bytes); } + +int bdrv_map(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_map) { + return -ENOTSUP; + } + return drv->bdrv_map(bs, guest_offset, host_offset, + contiguous_bytes); +} diff --git a/block.h b/block.h index 8207389..ed21ead 100644 --- a/block.h +++ b/block.h @@ -254,6 +254,8 @@ 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); +int bdrv_map(BlockDriverState *bs, uint64_t *guest_offset, + uint64_t *host_offset, uint64_t *contiguous_bytes); typedef enum { BLKDBG_L1_UPDATE, -- 1.7.6.rc1