qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v2 4/5] block: add bdrv_map()


From: Devin Nakamura
Subject: [Qemu-devel] [PATCH v2 4/5] block: add bdrv_map()
Date: Mon, 11 Jul 2011 15:52:44 -0400

Signed-off-by: Devin Nakamura <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]