[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v8 32/43] nbd: Use CAF when looking for dirty bitmap
From: |
Max Reitz |
Subject: |
[PATCH v8 32/43] nbd: Use CAF when looking for dirty bitmap |
Date: |
Tue, 1 Sep 2020 16:34:13 +0200 |
When looking for a dirty bitmap to share, we should handle filters by
just including them in the search (so they do not break backing chains).
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
---
nbd/server.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/nbd/server.c b/nbd/server.c
index c5d71cff10..982de67816 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -1567,13 +1567,13 @@ NBDExport *nbd_export_new(BlockDriverState *bs,
uint64_t dev_offset,
if (bitmap) {
BdrvDirtyBitmap *bm = NULL;
- while (true) {
+ while (bs) {
bm = bdrv_find_dirty_bitmap(bs, bitmap);
- if (bm != NULL || bs->backing == NULL) {
+ if (bm != NULL) {
break;
}
- bs = bs->backing->bs;
+ bs = bdrv_filter_or_cow_bs(bs);
}
if (bm == NULL) {
--
2.26.2
- [PATCH v8 24/43] block/null: Implement bdrv_get_allocated_file_size, (continued)
- [PATCH v8 24/43] block/null: Implement bdrv_get_allocated_file_size, Max Reitz, 2020/09/01
- [PATCH v8 25/43] blockdev: Use CAF in external_snapshot_prepare(), Max Reitz, 2020/09/01
- [PATCH v8 26/43] block: Report data child for query-blockstats, Max Reitz, 2020/09/01
- [PATCH v8 27/43] block: Use child access functions for QAPI queries, Max Reitz, 2020/09/01
- [PATCH v8 28/43] block-copy: Use CAF to find sync=top base, Max Reitz, 2020/09/01
- [PATCH v8 29/43] mirror: Deal with filters, Max Reitz, 2020/09/01
- [PATCH v8 30/43] backup: Deal with filters, Max Reitz, 2020/09/01
- [PATCH v8 31/43] commit: Deal with filters, Max Reitz, 2020/09/01
- [PATCH v8 32/43] nbd: Use CAF when looking for dirty bitmap,
Max Reitz <=
- [PATCH v8 33/43] qemu-img: Use child access functions, Max Reitz, 2020/09/01
- [PATCH v8 34/43] block: Drop backing_bs(), Max Reitz, 2020/09/01
- [PATCH v8 35/43] blockdev: Fix active commit choice, Max Reitz, 2020/09/01
- [PATCH v8 36/43] block: Inline bdrv_co_block_status_from_*(), Max Reitz, 2020/09/01
- [PATCH v8 37/43] block: Leave BDS.backing_{file,format} constant, Max Reitz, 2020/09/01
- [PATCH v8 38/43] iotests: Test that qcow2's data-file is flushed, Max Reitz, 2020/09/01
- [PATCH v8 39/43] iotests: Let complete_and_wait() work with commit, Max Reitz, 2020/09/01
- [PATCH v8 41/43] iotests: Add filter mirror test cases, Max Reitz, 2020/09/01
- [PATCH v8 40/43] iotests: Add filter commit test cases, Max Reitz, 2020/09/01