mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 06:43:53 -06:00
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>
This commit is contained in:
parent
4935e8be22
commit
93393e698c
3 changed files with 26 additions and 20 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue