* [PATCH] qcow2: Tweak comments on qcow2_get_persistent_dirty_bitmap_size
@ 2020-06-08 19:08 Eric Blake
2020-06-08 19:23 ` Kevin Wolf
0 siblings, 1 reply; 2+ messages in thread
From: Eric Blake @ 2020-06-08 19:08 UTC (permalink / raw)
To: qemu-devel
Cc: Kevin Wolf, Vladimir Sementsov-Ogievskiy, John Snow,
open list:qcow2, Max Reitz
For now, we don't have persistent bitmaps in any other formats, but
that might not be true in the future. Make it obvious that our
incoming parameter is not necessarily a qcow2 image, and therefore is
limited to just the bdrv_dirty_bitmap_* API calls (rather than probing
into qcow2 internals).
Suggested-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
---
block/qcow2-bitmap.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c
index 7bf12502da8c..1f38806ca6ea 100644
--- a/block/qcow2-bitmap.c
+++ b/block/qcow2-bitmap.c
@@ -1757,19 +1757,20 @@ bool qcow2_supports_persistent_dirty_bitmap(BlockDriverState *bs)
}
/*
- * Compute the space required for bitmaps in @bs.
+ * Compute the space required to copy bitmaps from @in_bs.
*
* The computation is based as if copying to a new image with the
- * given @cluster_size, which may differ from the cluster size in @bs.
+ * given @cluster_size, which may differ from the cluster size in
+ * @in_bs; in fact, @in_bs might be something other than qcow2.
*/
-uint64_t qcow2_get_persistent_dirty_bitmap_size(BlockDriverState *bs,
+uint64_t qcow2_get_persistent_dirty_bitmap_size(BlockDriverState *in_bs,
uint32_t cluster_size)
{
uint64_t bitmaps_size = 0;
BdrvDirtyBitmap *bm;
size_t bitmap_dir_size = 0;
- FOR_EACH_DIRTY_BITMAP(bs, bm) {
+ FOR_EACH_DIRTY_BITMAP(in_bs, bm) {
if (bdrv_dirty_bitmap_get_persistence(bm)) {
const char *name = bdrv_dirty_bitmap_name(bm);
uint32_t granularity = bdrv_dirty_bitmap_granularity(bm);
--
2.27.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] qcow2: Tweak comments on qcow2_get_persistent_dirty_bitmap_size
2020-06-08 19:08 [PATCH] qcow2: Tweak comments on qcow2_get_persistent_dirty_bitmap_size Eric Blake
@ 2020-06-08 19:23 ` Kevin Wolf
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Wolf @ 2020-06-08 19:23 UTC (permalink / raw)
To: Eric Blake
Cc: Vladimir Sementsov-Ogievskiy, John Snow, qemu-devel,
open list:qcow2, Max Reitz
Am 08.06.2020 um 21:08 hat Eric Blake geschrieben:
> For now, we don't have persistent bitmaps in any other formats, but
> that might not be true in the future. Make it obvious that our
> incoming parameter is not necessarily a qcow2 image, and therefore is
> limited to just the bdrv_dirty_bitmap_* API calls (rather than probing
> into qcow2 internals).
>
> Suggested-by: Kevin Wolf <kwolf@redhat.com>
> Signed-off-by: Eric Blake <eblake@redhat.com>
Thanks, applied to the block branch.
Kevin
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-06-08 19:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-08 19:08 [PATCH] qcow2: Tweak comments on qcow2_get_persistent_dirty_bitmap_size Eric Blake
2020-06-08 19:23 ` Kevin Wolf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.