diff options
author | Max Reitz <mreitz@redhat.com> | 2019-06-12 17:03:38 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2020-09-07 12:31:31 +0200 |
commit | 93393e698c76c9b95b1fcf9649eef41f9cdbbb07 (patch) | |
tree | 4efe6b10f5caf6cfe4b75a15812aff8703e4df95 /migration/block-dirty-bitmap.c | |
parent | 4935e8be22745ff2b23bc87a5015176d991ce233 (diff) |
block: Use bdrv_filter_(bs|child) where obvious
Places that use patterns like
if (bs->drv->is_filter && bs->file) {
... something about bs->file->bs ...
}
should be
BlockDriverState *filtered = bdrv_filter_bs(bs);
if (filtered) {
... something about @filtered ...
}
instead.
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 'migration/block-dirty-bitmap.c')
-rw-r--r-- | migration/block-dirty-bitmap.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c index 549e14daba..5bef793ac0 100644 --- a/migration/block-dirty-bitmap.c +++ b/migration/block-dirty-bitmap.c @@ -615,13 +615,7 @@ static int init_dirty_bitmap_migration(DBMSaveState *s) while (bs && bs->drv && bs->drv->is_filter && !bdrv_has_named_bitmaps(bs)) { - if (bs->backing) { - bs = bs->backing->bs; - } else if (bs->file) { - bs = bs->file->bs; - } else { - bs = NULL; - } + bs = bdrv_filter_bs(bs); } if (bs && bs->drv && !bs->drv->is_filter) { |