block: bdrv_reopen_parse_backing(): simplify handling implicit filters
commitcbfdb98ce21532e6705fdbf324583f99602e183a
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Thu, 10 Jun 2021 12:05:33 +0000 (10 15:05 +0300)
committerKevin Wolf <kwolf@redhat.com>
Tue, 29 Jun 2021 14:51:00 +0000 (29 16:51 +0200)
tree8b5167f2aea364fc0fdedcf8cf66be9e0f8b1dd9
parentbfae052a57d20af91b2fd9fb92469be6283f4820
block: bdrv_reopen_parse_backing(): simplify handling implicit filters

The logic around finding overlay here is not obvious. Actually it does
two simple things:

1. If new bs is already in backing chain, split from parent bs by
   several implicit filters we are done, do nothing.

2. Otherwise, don't try to replace implicit filter.

Let's rewrite this in more obvious way.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20210610120537.196183-6-vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c