[Qemu-devel] [PATCH 1/2] block: make bdrv_get_cluster_size public

jemmy858585@gmail.com posted 2 patches 8 years, 10 months ago
[Qemu-devel] [PATCH 1/2] block: make bdrv_get_cluster_size public
Posted by jemmy858585@gmail.com 8 years, 10 months ago
From: Lidong Chen <lidongchen@tencent.com>

The bdrv_get_cluster_size function is need by block migration
to optimize zero cluster.

Signed-off-by: Lidong Chen <lidongchen@tencent.com>
---
 block/io.c            | 2 +-
 include/block/block.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/block/io.c b/block/io.c
index 2709a70..1c31c2b 100644
--- a/block/io.c
+++ b/block/io.c
@@ -459,7 +459,7 @@ void bdrv_round_to_clusters(BlockDriverState *bs,
     }
 }
 
-static int bdrv_get_cluster_size(BlockDriverState *bs)
+int bdrv_get_cluster_size(BlockDriverState *bs)
 {
     BlockDriverInfo bdi;
     int ret;
diff --git a/include/block/block.h b/include/block/block.h
index 5149260..a0d78fc 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -473,6 +473,7 @@ void bdrv_round_to_clusters(BlockDriverState *bs,
                             int64_t offset, unsigned int bytes,
                             int64_t *cluster_offset,
                             unsigned int *cluster_bytes);
+int bdrv_get_cluster_size(BlockDriverState *bs);
 
 const char *bdrv_get_encrypted_filename(BlockDriverState *bs);
 void bdrv_get_backing_filename(BlockDriverState *bs,
-- 
1.8.3.1