]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/loongarch: Fix the cpu unplug resource leak
authorXianglai Li <lixianglai@loongson.cn>
Mon, 24 Mar 2025 12:33:28 +0000 (20:33 +0800)
committerSong Gao <gaosong@loongson.cn>
Thu, 27 Mar 2025 12:29:17 +0000 (20:29 +0800)
commit0c346576e401d83becb075e70fef207a09afc3e6
treeff9d82750376eab5e61940a63b21671ae61a3fc0
parentb876e721f1c939f3e83ac85bd3c1c2821e12b3fa
target/loongarch: Fix the cpu unplug resource leak

When the cpu is created, qemu_add_vm_change_state_handler
is called in the kvm_arch_init_vcpu function to create
the VMChangeStateEntry resource.

However, the resource is not released when the cpu is destroyed.
This results in a qemu process segment error when the virtual
machine restarts after the cpu is unplugged.

This patch solves the problem by adding the corresponding resource
release process to the kvm_arch_destroy_vcpu function.

Signed-off-by: Xianglai Li <lixianglai@loongson.cn>
Reviewed-by: Bibo Mao <maobibo@loongson.cn>
Message-Id: <20250324123328.518076-1-lixianglai@loongson.cn>
Signed-off-by: Song Gao <gaosong@loongson.cn>
target/loongarch/cpu.h
target/loongarch/kvm/kvm.c