On Fri, Apr 19, 2024 at 11:08:22AM +0200, Philippe Mathieu-Daudé wrote: > Date: Fri, 19 Apr 2024 11:08:22 +0200 > From: Philippe Mathieu-Daudé <phi...@linaro.org> > Subject: Re: [PATCH 3/6] target/s390x/cpu_models: Make > kvm_s390_get_host_cpu_model() return boolean > > On 19/4/24 10:44, Zhao Liu wrote: > > 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 <th...@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....@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. > > Or try to rebase your series on this untested patch: > https://lore.kernel.org/qemu-devel/20240419090631.48055-1-phi...@linaro.org/ >
Good, pls let me pick this patch into my v2.