On 6/12/19 5:09 PM, Max Reitz wrote: > 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 > --- > nbd/server.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) Reviewed-by: Eric Blake > > diff --git a/nbd/server.c b/nbd/server.c > index aeca3893fe..0d51d46b81 100644 > --- a/nbd/server.c > +++ b/nbd/server.c > @@ -1508,13 +1508,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_filtered_bs(bs); > } > > if (bm == NULL) { > -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org