[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 12/13] softmmu/cpus: Free cpu->thread in generic_destroy_vcpu_
|
From: |
Philippe Mathieu-Daudé |
|
Subject: |
[PATCH v4 12/13] softmmu/cpus: Free cpu->thread in generic_destroy_vcpu_thread() |
|
Date: |
Wed, 23 Mar 2022 18:17:50 +0100 |
From: Mark Kanda <mark.kanda@oracle.com>
Free cpu->thread in a new AccelOpsClass::destroy_vcpu_thread() handler
generic_destroy_vcpu_thread().
vCPU hotunplug related leak reported by Valgrind:
==102631== 8 bytes in 1 blocks are definitely lost in loss record 1,037 of
8,555
==102631== at 0x4C3ADBB: calloc (vg_replace_malloc.c:1117)
==102631== by 0x69EE4CD: g_malloc0 (in /usr/lib64/libglib-2.0.so.0.5600.4)
==102631== by 0x92443A: kvm_start_vcpu_thread (kvm-accel-ops.c:68)
==102631== by 0x4505C2: qemu_init_vcpu (cpus.c:643)
==102631== by 0x76B4D1: x86_cpu_realizefn (cpu.c:6520)
==102631== by 0x9344A7: device_set_realized (qdev.c:531)
==102631== by 0x93E329: property_set_bool (object.c:2273)
==102631== by 0x93C2F8: object_property_set (object.c:1408)
==102631== by 0x940796: object_property_set_qobject (qom-qobject.c:28)
==102631== by 0x93C663: object_property_set_bool (object.c:1477)
==102631== by 0x933D3B: qdev_realize (qdev.c:333)
==102631== by 0x455EC4: qdev_device_add_from_qdict (qdev-monitor.c:713)
Signed-off-by: Mark Kanda <mark.kanda@oracle.com>
Message-Id: <20220321141409.3112932-3-mark.kanda@oracle.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
softmmu/cpus.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/softmmu/cpus.c b/softmmu/cpus.c
index 37325b3b8d..efa8397f04 100644
--- a/softmmu/cpus.c
+++ b/softmmu/cpus.c
@@ -619,6 +619,7 @@ static void common_vcpu_thread_create(CPUState *cpu)
static void common_vcpu_thread_destroy(CPUState *cpu)
{
+ g_free(cpu->thread);
}
void cpu_remove_sync(CPUState *cpu)
--
2.35.1
- [PATCH v4 07/13] accel-ops: Introduce create_vcpu_thread_precheck / postcheck handlers, (continued)
- [PATCH v4 07/13] accel-ops: Introduce create_vcpu_thread_precheck / postcheck handlers, Philippe Mathieu-Daudé, 2022/03/23
- [PATCH v4 08/13] accel/tcg: Extract rr_create_vcpu_thread_precheck(), Philippe Mathieu-Daudé, 2022/03/23
- [PATCH v4 09/13] accel/all: Extract common_vcpu_thread_create(), Philippe Mathieu-Daudé, 2022/03/23
- [PATCH v4 10/13] accel-ops: Introduce common_vcpu_thread_destroy() and .precheck handler, Philippe Mathieu-Daudé, 2022/03/23
- [PATCH v4 11/13] accel/tcg: Add rr_destroy_vcpu_thread_precheck(), Philippe Mathieu-Daudé, 2022/03/23
- [PATCH v4 12/13] softmmu/cpus: Free cpu->thread in generic_destroy_vcpu_thread(),
Philippe Mathieu-Daudé <=
- [PATCH v4 13/13] softmmu/cpus: Free cpu->halt_cond in generic_destroy_vcpu_thread(), Philippe Mathieu-Daudé, 2022/03/23