block: Assert that drv->bdrv_child_perm is set in bdrv_child_perm()
commit0b3ca76e52f025caf234b77d471465e983a711d0
authorAlberto Garcia <berto@igalia.com>
Thu, 4 Apr 2019 11:29:53 +0000 (4 14:29 +0300)
committerMax Reitz <mreitz@redhat.com>
Tue, 7 May 2019 15:14:21 +0000 (7 17:14 +0200)
tree8fb17e78f1ee5275ff0ac74c43e05ff3e4d97626
parent21205c7c3bd0910d7b71274ddbede9c7001e1cb4
block: Assert that drv->bdrv_child_perm is set in bdrv_child_perm()

There is no need to check for this because all block drivers that have
children implement bdrv_child_perm and all callers already ensure that
bs->drv is set.

Furthermore, if this check would fail then the callers would end up
with uninitialized values for nperm and nshared.

This patch replaces the check with an assertion.

Signed-off-by: Alberto Garcia <berto@igalia.com>
Message-id: 20190404112953.4058-1-berto@igalia.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
block.c