From dc8ea42297cb2a8a7c4a7577e4f416d756d2b9fb Mon Sep 17 00:00:00 2001 From: Jiaqing Zhao Date: Fri, 26 Apr 2024 05:55:18 +0000 Subject: [PATCH] dm: deinit iothreads on vm reset iothreads are created by emulated block devices like virtio. These devices are resetted on vm reset, but these iothreads are not freed, causing a resource leak. Fix it by deinit all iothreads on vm reset. Tracked-On: #8612 Signed-off-by: Jiaqing Zhao Reviewed-by: Jian Jun Chen --- devicemodel/core/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/devicemodel/core/main.c b/devicemodel/core/main.c index a3ece87ee..f52a057c9 100644 --- a/devicemodel/core/main.c +++ b/devicemodel/core/main.c @@ -674,6 +674,8 @@ vm_reset_vdevs(struct vmctx *ctx) pci_irq_deinit(ctx); ioapic_deinit(); + iothread_deinit(); + pci_irq_init(ctx); atkbdc_init(ctx); vrtc_init(ctx);