[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/6] target/s390x/cpu_models: Make kvm_s390_get_host_cpu_mode
From: |
Zhao Liu |
Subject: |
Re: [PATCH 3/6] target/s390x/cpu_models: Make kvm_s390_get_host_cpu_model() return boolean |
Date: |
Fri, 19 Apr 2024 16:44:49 +0800 |
Hi Thomas,
On Fri, Apr 19, 2024 at 09:50:46AM +0200, Thomas Huth wrote:
> Date: Fri, 19 Apr 2024 09:50:46 +0200
> From: Thomas Huth <thuth@redhat.com>
> Subject: Re: [PATCH 3/6] target/s390x/cpu_models: Make
> kvm_s390_get_host_cpu_model() return boolean
>
> On 19/04/2024 08.57, Zhao Liu wrote:
> > From: Zhao Liu <zhao1.liu@intel.com>
> >
> > As error.h suggested, the best practice for callee is to return
> > something to indicate success / failure.
> >
> > So make kvm_s390_get_host_cpu_model() return boolean and check the
> > returned boolean in get_max_cpu_model() instead of accessing @err.
> >
> > Additionally, since now get_max_cpu_model() returns directly if
> > kvm_s390_get_host_cpu_model() fills @err, so make
> > kvm_s390_get_host_cpu_model() return true by default for the non-KVM
> > case in target/s390x/cpu_models.h.
>
> You could also argue the other way round that there should be something in
> *model if it returns "true" ... anyway, the stub should never be executed,
> so it likely doesn't matter too much, but I'd still prefer if we'd rather
> return "false" in the non-KVM stub instead.
I see, since this interface in wrapped in kvm_enabled() condition, so
the non-kvm sutb wouldn't be called.
Thanks! Will change to return false.
Regards,
Zhao
[PATCH 4/6] target/s390x/cpu_models: Drop local @err in get_max_cpu_model(), Zhao Liu, 2024/04/19
[PATCH 5/6] target/s390x/cpu_models: Make kvm_s390_apply_cpu_model() return boolean, Zhao Liu, 2024/04/19
[PATCH 6/6] target/s390x/cpu_models_sysemu: Drop local @err in apply_cpu_model(), Zhao Liu, 2024/04/19
Re: [PATCH 0/6] s390x/cpu_models: Misc cleanup on returned error code and local @err variables, Philippe Mathieu-Daudé, 2024/04/19