On Thu, Feb 29, 2024 at 12:37:15AM +0800, Zhao Liu wrote:
> From: Zhao Liu <[email protected]>
>
> As the comment in qapi/error, passing @errp to error_prepend() requires
> ERRP_GUARD():
>
>
> In block/qcow2.c, there're 2 functions passing @errp to error_prepend()
s/there're/there are/
> without ERRP_GUARD():
> - qcow2_co_create()
> - qcow2_co_truncate()
>
> Their @errp parameters are so widely sourced that it is necessary to
> protect their @errp with ERRP_GUARD().
>
> Therefore, to avoid the issue like [1] said, add missing ERRP_GUARD() at
> their beginning.
>
> [1]: Issue description in the commit message of commit ae7c80a7bd73
> ("error: New macro ERRP_GUARD()").
>
> Cc: Kevin Wolf <[email protected]>
> Cc: Hanna Reitz <[email protected]>
> Signed-off-by: Zhao Liu <[email protected]>
> ---
> block/qcow2.c | 2 ++
> 1 file changed, 2 insertions(+)
Reviewed-by: Eric Blake <[email protected]>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization: qemu.org | libguestfs.org