]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/i386/kvm: Clean up error handling in kvm_arch_init()
authorZhao Liu <zhao1.liu@intel.com>
Wed, 6 Nov 2024 03:07:27 +0000 (11:07 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 10 Jan 2025 22:34:44 +0000 (23:34 +0100)
commitd2401a6eae8f8fbd8e569c8b0638f0cbc80ec88e
treec7d6d07c43dcc84db027af9c421f2e10ac302bd1
parentd7f895cb62f3a709e7b9aeeab19678811deda973
target/i386/kvm: Clean up error handling in kvm_arch_init()

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.
* MSR filter related cases called exit() directly instead of returning
  to kvm_init(). (The caller of kvm_arch_init() - kvm_init() - needs to
  know if kvm_arch_init() fails in order to perform cleanup).

Fix the above cases.

Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Zide Chen <zide.chen@intel.com>
Link: https://lore.kernel.org/r/20241106030728.553238-11-zhao1.liu@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/kvm/kvm.c