block: Add bdrv_recurse_can_replace()
commit5d69b5ab85d30201c1f5ef34651ba910977fc583
authorMax Reitz <mreitz@redhat.com>
Tue, 18 Feb 2020 10:34:41 +0000 (18 11:34 +0100)
committerKevin Wolf <kwolf@redhat.com>
Tue, 18 Feb 2020 10:55:39 +0000 (18 11:55 +0100)
tree331cf09380c717614400c7905a3a0e8aa0681128
parent37a3791b380584949046af6b62b54869390616dc
block: Add bdrv_recurse_can_replace()

After a couple of follow-up patches, this function will replace
bdrv_recurse_is_first_non_filter() in check_to_replace_node().

bdrv_recurse_is_first_non_filter() is both not sufficiently specific for
check_to_replace_node() (it allows cases that should not be allowed,
like replacing child nodes of quorum with dissenting data that have more
parents than just quorum), and it is too restrictive (it is perfectly
fine to replace filters).

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200218103454.296704-7-mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c
include/block/block_int.h