Re: [PATCH 17/17] target/s390x/cpu_models: Fix missing ERRP_GUARD() for error_prepend()

2024-03-08 Thread Thomas Huth
On 08/03/2024 11.12, Zhao Liu wrote: Hi Thomas, void s390_realize_cpu_model(CPUState *cs, Error **errp) { +ERRP_GUARD(); Error *err = NULL; I think that function could use an additional clean-up now: Remove the local "err" variable and use "errp" only instead. Since many c

Re: [PATCH 17/17] target/s390x/cpu_models: Fix missing ERRP_GUARD() for error_prepend()

2024-03-08 Thread Zhao Liu
Hi Thomas, > > void s390_realize_cpu_model(CPUState *cs, Error **errp) > > { > > +ERRP_GUARD(); > > Error *err = NULL; > > I think that function could use an additional clean-up now: Remove the local > "err" variable and use "errp" only instead. > Since many cases check @err to det

Re: [PATCH 17/17] target/s390x/cpu_models: Fix missing ERRP_GUARD() for error_prepend()

2024-02-29 Thread Zhao Liu
> > diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c > > index a63d990e4e8e..1a1c09612271 100644 > > --- a/target/s390x/cpu_models.c > > +++ b/target/s390x/cpu_models.c > > @@ -503,6 +503,7 @@ static void error_prepend_missing_feat(const char > > *name, void *opaque) > > static

Re: [PATCH 17/17] target/s390x/cpu_models: Fix missing ERRP_GUARD() for error_prepend()

2024-02-29 Thread Thomas Huth
On 29/02/2024 15.39, Zhao Liu wrote: From: Zhao Liu As the comment in qapi/error, passing @errp to error_prepend() requires ERRP_GUARD(): * = Why, when and how to use ERRP_GUARD() = * * Without ERRP_GUARD(), use of the @errp parameter is restricted: ... * - It should not be passed to error_pre

[PATCH 17/17] target/s390x/cpu_models: Fix missing ERRP_GUARD() for error_prepend()

2024-02-29 Thread Zhao Liu
From: Zhao Liu As the comment in qapi/error, passing @errp to error_prepend() requires ERRP_GUARD(): * = Why, when and how to use ERRP_GUARD() = * * Without ERRP_GUARD(), use of the @errp parameter is restricted: ... * - It should not be passed to error_prepend(), error_vprepend() or * error_a