[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH for-4.1] block: Assert that drv->bdrv_child_perm
From: |
Max Reitz |
Subject: |
Re: [Qemu-block] [PATCH for-4.1] block: Assert that drv->bdrv_child_perm is set in bdrv_child_perm() |
Date: |
Fri, 26 Apr 2019 23:09:58 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 |
On 04.04.19 13:29, Alberto Garcia wrote:
> 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 <address@hidden>
> ---
> block.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
Thanks, applied to my block branch:
https://git.xanclic.moe/XanClic/qemu/commits/branch/block
Max
signature.asc
Description: OpenPGP digital signature