[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 08/23] block/block-copy: move copy_bitmap initialization to block_
From: |
Hanna Reitz |
Subject: |
[PULL 08/23] block/block-copy: move copy_bitmap initialization to block_copy_state_new() |
Date: |
Mon, 7 Mar 2022 11:35:34 +0100 |
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
We are going to complicate bitmap initialization in the further
commit. And in future, backup job will be able to work without filter
(when source is immutable), so we'll need same bitmap initialization in
copy-before-write filter and in backup job. So, it's reasonable to do
it in block-copy.
Note that for now cbw_open() is the only caller of
block_copy_state_new().
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220303194349.2304213-2-vsementsov@virtuozzo.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
---
block/block-copy.c | 1 +
block/copy-before-write.c | 4 ----
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/block/block-copy.c b/block/block-copy.c
index ce116318b5..abda7a80bd 100644
--- a/block/block-copy.c
+++ b/block/block-copy.c
@@ -402,6 +402,7 @@ BlockCopyState *block_copy_state_new(BdrvChild *source,
BdrvChild *target,
return NULL;
}
bdrv_disable_dirty_bitmap(copy_bitmap);
+ bdrv_set_dirty_bitmap(copy_bitmap, 0, bdrv_dirty_bitmap_size(copy_bitmap));
/*
* If source is in backing chain of target assume that target is going to
be
diff --git a/block/copy-before-write.c b/block/copy-before-write.c
index 80b7684dba..8ea2548ed9 100644
--- a/block/copy-before-write.c
+++ b/block/copy-before-write.c
@@ -149,7 +149,6 @@ static int cbw_open(BlockDriverState *bs, QDict *options,
int flags,
Error **errp)
{
BDRVCopyBeforeWriteState *s = bs->opaque;
- BdrvDirtyBitmap *copy_bitmap;
bs->file = bdrv_open_child(NULL, options, "file", bs, &child_of_bds,
BDRV_CHILD_FILTERED | BDRV_CHILD_PRIMARY,
@@ -177,9 +176,6 @@ static int cbw_open(BlockDriverState *bs, QDict *options,
int flags,
return -EINVAL;
}
- copy_bitmap = block_copy_dirty_bitmap(s->bcs);
- bdrv_set_dirty_bitmap(copy_bitmap, 0, bdrv_dirty_bitmap_size(copy_bitmap));
-
return 0;
}
--
2.34.1
- [PULL 16/23] block/reqlist: add reqlist_wait_all(), (continued)
- [PULL 16/23] block/reqlist: add reqlist_wait_all(), Hanna Reitz, 2022/03/07
- [PULL 17/23] block/io: introduce block driver snapshot-access API, Hanna Reitz, 2022/03/07
- [PULL 22/23] iotests/image-fleecing: add test case with bitmap, Hanna Reitz, 2022/03/07
- [PULL 14/23] block/reqlist: reqlist_find_conflict(): use ranges_overlap(), Hanna Reitz, 2022/03/07
- [PULL 18/23] block: introduce snapshot-access block driver, Hanna Reitz, 2022/03/07
- [PULL 20/23] iotests/image-fleecing: add test-case for fleecing format node, Hanna Reitz, 2022/03/07
- [PULL 21/23] iotests.py: add qemu_io_pipe_and_status(), Hanna Reitz, 2022/03/07
- [PULL 15/23] block/dirty-bitmap: introduce bdrv_dirty_bitmap_status(), Hanna Reitz, 2022/03/07
- [PULL 19/23] block: copy-before-write: realize snapshot-access API, Hanna Reitz, 2022/03/07
- [PULL 23/23] iotests/image-fleecing: test push backup with fleecing, Hanna Reitz, 2022/03/07
- [PULL 08/23] block/block-copy: move copy_bitmap initialization to block_copy_state_new(),
Hanna Reitz <=
- Re: [PULL 00/23] Block patches, Peter Maydell, 2022/03/07