From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:40415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdxS1-00084L-GH for qemu-devel@nongnu.org; Tue, 05 Jul 2011 00:41:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QdxS0-0000TG-2V for qemu-devel@nongnu.org; Tue, 05 Jul 2011 00:41:33 -0400 Received: from mail-gx0-f173.google.com ([209.85.161.173]:54493) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdxRz-0000T3-Ha for qemu-devel@nongnu.org; Tue, 05 Jul 2011 00:41:31 -0400 Received: by gxk26 with SMTP id 26so2602942gxk.4 for ; Mon, 04 Jul 2011 21:41:30 -0700 (PDT) From: Devin Nakamura Date: Tue, 5 Jul 2011 00:41:24 -0400 Message-Id: <1309840884-32409-5-git-send-email-devin122@gmail.com> In-Reply-To: <1309840884-32409-1-git-send-email-devin122@gmail.com> References: <1309840884-32409-1-git-send-email-devin122@gmail.com> Subject: [Qemu-devel] [PATCH 5/5] block: add bdrv_copy_header() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Signed-off-by: Devin Nakamura --- block.c | 10 ++++++++++ block.h | 2 ++ 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/block.c b/block.c index c9ea201..c6c36e7 100644 --- a/block.c +++ b/block.c @@ -3061,3 +3061,13 @@ int bdrv_map(BlockDriverState *bs, uint64_t *guest_offset, return drv->bdrv_map(bs, guest_offset, host_offset, contiguous_bytes); } + +int bdrv_copy_header(BlockDriverState *bs) +{ + BlockDriver *drv = bs->drv; + if (!drv) + return -ENOMEDIUM; + if (!drv->bdrv_copy_header) + return -ENOTSUP; + return drv->bdrv_copy_header(bs); +} diff --git a/block.h b/block.h index ed21ead..0583875 100644 --- a/block.h +++ b/block.h @@ -256,6 +256,8 @@ 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); +int bdrv_copy_header(BlockDriverState *bs); + typedef enum { BLKDBG_L1_UPDATE, -- 1.7.6.rc1