From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:47584) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qgz26-0005xf-Hg for qemu-devel@nongnu.org; Wed, 13 Jul 2011 08:59:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qgz24-0006Qe-Pw for qemu-devel@nongnu.org; Wed, 13 Jul 2011 08:59:17 -0400 Received: from mail-gw0-f45.google.com ([74.125.83.45]:58827) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qgz24-0006Nw-D8 for qemu-devel@nongnu.org; Wed, 13 Jul 2011 08:59:16 -0400 Received: by mail-gw0-f45.google.com with SMTP id 19so2785192gwb.4 for ; Wed, 13 Jul 2011 05:59:16 -0700 (PDT) From: Devin Nakamura Date: Wed, 13 Jul 2011 08:57:44 -0400 Message-Id: <1310561864-18964-6-git-send-email-devin122@gmail.com> In-Reply-To: <1310561864-18964-1-git-send-email-devin122@gmail.com> References: <1310561864-18964-1-git-send-email-devin122@gmail.com> Subject: [Qemu-devel] [PATCH v3 6/6] block: add bdrv_copy_header() 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 | 12 ++++++++++++ block.h | 2 ++ 2 files changed, 14 insertions(+), 0 deletions(-) diff --git a/block.c b/block.c index 86a4752..0f38aff 100644 --- a/block.c +++ b/block.c @@ -3105,3 +3105,15 @@ 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 baf6f10..169866c 100644 --- a/block.h +++ b/block.h @@ -259,6 +259,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