diff options
author | Max Reitz <mreitz@redhat.com> | 2019-06-12 18:55:04 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2020-09-07 12:31:31 +0200 |
commit | ee2f94ca2799f3a6536cf19235c9bb44be919956 (patch) | |
tree | 0c519cee43e68a0c5e8705a4d7d1c5f90c33315a /nbd | |
parent | 9a71b9de3f08941577a9760021f52771aaba4fa4 (diff) |
nbd: Use CAF when looking for dirty bitmap
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>
Diffstat (limited to 'nbd')
-rw-r--r-- | nbd/server.c | 6 |
1 files 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) { |