[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 06/43] qcow2: Tweak comments on qcow2_get_persistent_dirty_bitmap_
From: |
Kevin Wolf |
Subject: |
[PULL 06/43] qcow2: Tweak comments on qcow2_get_persistent_dirty_bitmap_size |
Date: |
Wed, 17 Jun 2020 16:48:32 +0200 |
From: Eric Blake <eblake@redhat.com>
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>
Message-Id: <20200608190821.3293867-1-eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@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 7bf12502da..1f38806ca6 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.25.4
- [PULL 00/43] Block layer patches, Kevin Wolf, 2020/06/17
- [PULL 01/43] hw/ide: Make IDEDMAOps handlers take a const IDEDMA pointer, Kevin Wolf, 2020/06/17
- [PULL 04/43] virtio-blk: On restart, process queued requests in the proper context, Kevin Wolf, 2020/06/17
- [PULL 03/43] virtio-blk: Refactor the code that processes queued requests, Kevin Wolf, 2020/06/17
- [PULL 02/43] icount: make dma reads deterministic, Kevin Wolf, 2020/06/17
- [PULL 06/43] qcow2: Tweak comments on qcow2_get_persistent_dirty_bitmap_size,
Kevin Wolf <=
- [PULL 05/43] block: Refactor subdirectory recursion during make, Kevin Wolf, 2020/06/17
- [PULL 07/43] hw/block/nvme: fix pci doorbell size calculation, Kevin Wolf, 2020/06/17
- [PULL 09/43] hw/block/nvme: remove superfluous breaks, Kevin Wolf, 2020/06/17
- [PULL 10/43] hw/block/nvme: move device parameters to separate struct, Kevin Wolf, 2020/06/17
- [PULL 12/43] hw/block/nvme: refactor nvme_addr_read, Kevin Wolf, 2020/06/17
- [PULL 13/43] hw/block/nvme: fix pin-based interrupt behavior, Kevin Wolf, 2020/06/17
- [PULL 08/43] hw/block/nvme: rename trace events to pci_nvme, Kevin Wolf, 2020/06/17
- [PULL 16/43] hw/block/nvme: factor out property/constraint checks, Kevin Wolf, 2020/06/17
- [PULL 15/43] hw/block/nvme: remove redundant cmbloc/cmbsz members, Kevin Wolf, 2020/06/17
- [PULL 11/43] hw/block/nvme: use constants in identify, Kevin Wolf, 2020/06/17