(1) granularity type consistency: Update the granularity to be uint64_t
in all places. This value is always in bytes.
(2) Some documentation for the fields within BdrvDirtyBitmap.
Signed-off-by: John Snow <address@hidden>
---
block.c | 16 ++++++++--------
include/block/block.h | 2 +-
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/block.c b/block.c
index 9e2b8c0..13f9cc0 100644
--- a/block.c
+++ b/block.c
@@ -52,13 +52,13 @@
#endif
struct BdrvDirtyBitmap {
- HBitmap *bitmap;
- BdrvDirtyBitmap *successor;
- int64_t size;
- int64_t granularity;
- char *name;
- bool enabled;
- bool frozen;
+ HBitmap *bitmap; /* Dirty sector bitmap */
+ BdrvDirtyBitmap *successor; /* Anonymous child */
+ int64_t size; /* Number of sectors */
+ uint64_t granularity; /* Granularity in bytes */
+ char *name; /* Optional non-empty unique ID */
+ bool enabled; /* Writes are being tracked */
+ bool frozen; /* Protected; see
bdrv_freeze_dirty_bitmap() */
QLIST_ENTRY(BdrvDirtyBitmap) list;
};
@@ -5350,7 +5350,7 @@ void
bdrv_dirty_bitmap_make_anon(BlockDriverState *bs, BdrvDirtyBitmap
*bitmap)
}
BdrvDirtyBitmap *bdrv_create_dirty_bitmap(BlockDriverState *bs,
- int granularity,
+ uint64_t granularity,
const char *name,
Error **errp)
{
diff --git a/include/block/block.h b/include/block/block.h
index 99ed679..749429e 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -430,7 +430,7 @@ bool bdrv_qiov_is_aligned(BlockDriverState *bs,
QEMUIOVector *qiov);
struct HBitmapIter;
typedef struct BdrvDirtyBitmap BdrvDirtyBitmap;
BdrvDirtyBitmap *bdrv_create_dirty_bitmap(BlockDriverState *bs,
- int granularity,
+ uint64_t granularity,
const char *name,
Error **errp);
int bdrv_dirty_bitmap_create_successor(BlockDriverState *bs,