[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 5/5] block: add bdrv_copy_header()
From: |
Devin Nakamura |
Subject: |
[Qemu-devel] [PATCH v2 5/5] block: add bdrv_copy_header() |
Date: |
Mon, 11 Jul 2011 15:45:19 -0400 |
Signed-off-by: Devin Nakamura <address@hidden>
---
block.c | 12 ++++++++++++
block.h | 2 ++
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/block.c b/block.c
index 39510cb..69a3e13 100644
--- a/block.c
+++ b/block.c
@@ -3065,3 +3065,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 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
- [Qemu-devel] [PATCH 1/5] block_int: add basic conversion api, Devin Nakamura, 2011/07/05
- [Qemu-devel] [PATCH 2/5] block: add bdrv_open_conversion_target, Devin Nakamura, 2011/07/05
- [Qemu-devel] [PATCH 3/5] block: add bdrv_get_mapping(), Devin Nakamura, 2011/07/05
- [Qemu-devel] [PATCH 4/5] block: add bdrv_map(), Devin Nakamura, 2011/07/05
- [Qemu-devel] [PATCH 5/5] block: add bdrv_copy_header(), Devin Nakamura, 2011/07/05
- [Qemu-devel] [PATCH v2 5/5] block: add bdrv_copy_header(),
Devin Nakamura <=
- Re: [Qemu-devel] [PATCH 1/5] block_int: add basic conversion api, Stefan Hajnoczi, 2011/07/05