block: refactor bdrv_list_refresh_perms to allow any list of nodes
commitfb0ff4d1baf8012e7f358daf007967d65e1f545a
authorVladimir Sementsov-Ogievskiy <vladimir.sementsov-ogievskiy@openvz.org>
Mon, 7 Nov 2022 16:35:58 +0000 (7 19:35 +0300)
committerKevin Wolf <kwolf@redhat.com>
Thu, 15 Dec 2022 15:07:42 +0000 (15 16:07 +0100)
treed829547a160792f3116b42dfe784b8e82eda6040
parentf1316edbfcea3b31181f22d737ac7cf80b395355
block: refactor bdrv_list_refresh_perms to allow any list of nodes

We are going to increase usage of collecting nodes in a list to then
update, and calling bdrv_topological_dfs() each time is not convenient,
and not correct as we are going to interleave graph modifying with
filling the node list.

So, let's switch to a function that takes any list of nodes, adds all
their subtrees and do topological sort. And finally, refresh
permissions.

While being here, make the function public, as we'll want to use it
from blockdev.c in near future.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@openvz.org>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20221107163558.618889-5-vsementsov@yandex-team.ru>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c