block: Unite remove_empty_child and child_free
commit04c9c3a52c21088e7039956e5a635250fe3eaee6
authorHanna Reitz <hreitz@redhat.com>
Mon, 15 Nov 2021 14:53:59 +0000 (15 15:53 +0100)
committerHanna Reitz <hreitz@redhat.com>
Tue, 16 Nov 2021 08:43:38 +0000 (16 09:43 +0100)
tree7eb4332c30dc7a2907dda59e39d7a13c5986bc07
parenta225369bce684c01095be52e1014e3fa91dec210
block: Unite remove_empty_child and child_free

Now that bdrv_remove_empty_child() no longer removes the child from the
parent's children list but only checks that it is not in such a list, it
is only a wrapper around bdrv_child_free() that checks that the child is
empty and unused.  That should apply to all children that we free, so
put those checks into bdrv_child_free() and drop
bdrv_remove_empty_child().

Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20211111120829.81329-4-hreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20211115145409.176785-4-kwolf@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
block.c