Re: [PATCH v5 10/11] target/i386/kvm: Clean up error handling in kvm_arch_init()

Zhao Liu
2024-12-25T02:55:29Z

On Tue, Dec 24, 2024 at 04:53:36PM +0100, Paolo Bonzini wrote:
> Date: Tue, 24 Dec 2024 16:53:36 +0100
> From: Paolo Bonzini <pbonzini@redhat.com>
> Subject: Re: [PATCH v5 10/11] target/i386/kvm: Clean up error handling in
> kvm_arch_init()
>
> On 11/6/24 04:07, Zhao Liu wrote:
> > Currently, there're following incorrect error handling cases in
> > kvm_arch_init():
> > * Missed to handle failure of kvm_get_supported_feature_msrs().
> > * Missed to return when kvm_vm_enable_disable_exits() fails.
>
> At least in these two cases I think it was intentional to avoid hard
> failures. It's probably not a very likely case and I think your patch is
> overall a good idea.

I have the idea to clean up the abort()/exit() in KVM and instead use
@errp to handle failure cases. However, this would be a big change, so
this patch only makes a small change, as a first step.

Thanks,
Zhao