[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 05/18] block: Add two dirty bitmap getters
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PULL 05/18] block: Add two dirty bitmap getters |
Date: |
Wed, 14 Sep 2016 18:40:49 +0200 |
From: Fam Zheng <address@hidden>
For dirty bitmap users to get the size and the name of a
BdrvDirtyBitmap.
Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: John Snow <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: John Snow <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
---
block/dirty-bitmap.c | 10 ++++++++++
include/block/dirty-bitmap.h | 2 ++
2 files changed, 12 insertions(+)
diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c
index 9c6febb..860acc9 100644
--- a/block/dirty-bitmap.c
+++ b/block/dirty-bitmap.c
@@ -154,6 +154,16 @@ void bdrv_dirty_bitmap_reset_meta(BlockDriverState *bs,
hbitmap_reset(bitmap->meta, sector, nb_sectors);
}
+int64_t bdrv_dirty_bitmap_size(const BdrvDirtyBitmap *bitmap)
+{
+ return bitmap->size;
+}
+
+const char *bdrv_dirty_bitmap_name(const BdrvDirtyBitmap *bitmap)
+{
+ return bitmap->name;
+}
+
bool bdrv_dirty_bitmap_frozen(BdrvDirtyBitmap *bitmap)
{
return bitmap->successor;
diff --git a/include/block/dirty-bitmap.h b/include/block/dirty-bitmap.h
index 69c500b..c4e7858 100644
--- a/include/block/dirty-bitmap.h
+++ b/include/block/dirty-bitmap.h
@@ -32,6 +32,8 @@ uint32_t bdrv_get_default_bitmap_granularity(BlockDriverState
*bs);
uint32_t bdrv_dirty_bitmap_granularity(BdrvDirtyBitmap *bitmap);
bool bdrv_dirty_bitmap_enabled(BdrvDirtyBitmap *bitmap);
bool bdrv_dirty_bitmap_frozen(BdrvDirtyBitmap *bitmap);
+const char *bdrv_dirty_bitmap_name(const BdrvDirtyBitmap *bitmap);
+int64_t bdrv_dirty_bitmap_size(const BdrvDirtyBitmap *bitmap);
DirtyBitmapStatus bdrv_dirty_bitmap_status(BdrvDirtyBitmap *bitmap);
int bdrv_get_dirty(BlockDriverState *bs, BdrvDirtyBitmap *bitmap,
int64_t sector);
--
2.5.5
- [Qemu-devel] [PULL 00/18] Block layer patches, Max Reitz, 2016/09/14
- [Qemu-devel] [PULL 01/18] block: Hide HBitmap in block dirty bitmap interface, Max Reitz, 2016/09/14
- [Qemu-devel] [PULL 02/18] HBitmap: Introduce "meta" bitmap to track bit changes, Max Reitz, 2016/09/14
- [Qemu-devel] [PULL 03/18] tests: Add test code for meta bitmap, Max Reitz, 2016/09/14
- [Qemu-devel] [PULL 04/18] block: Support meta dirty bitmap, Max Reitz, 2016/09/14
- [Qemu-devel] [PULL 05/18] block: Add two dirty bitmap getters,
Max Reitz <=
- [Qemu-devel] [PULL 06/18] block: Assert that bdrv_release_dirty_bitmap succeeded, Max Reitz, 2016/09/14
- [Qemu-devel] [PULL 07/18] hbitmap: serialization, Max Reitz, 2016/09/14
- [Qemu-devel] [PULL 08/18] block: BdrvDirtyBitmap serialization interface, Max Reitz, 2016/09/14
- [Qemu-devel] [PULL 10/18] block: More operations for meta dirty bitmap, Max Reitz, 2016/09/14
- [Qemu-devel] [PULL 09/18] tests: Add test code for hbitmap serialization, Max Reitz, 2016/09/14
- [Qemu-devel] [PULL 11/18] qemu-img: add the 'dd' subcommand, Max Reitz, 2016/09/14
- [Qemu-devel] [PULL 13/18] blockdev: prepare iSCSI block driver for dynamic loading, Max Reitz, 2016/09/14
- [Qemu-devel] [PULL 12/18] qemu-img: add skip option to dd, Max Reitz, 2016/09/14
- [Qemu-devel] [PULL 14/18] blockdev: Add dynamic generation of module_block.h, Max Reitz, 2016/09/14
- [Qemu-devel] [PULL 16/18] blockdev: Modularize nfs block driver, Max Reitz, 2016/09/14