[v2] migration: release MigrationIncomingState in migration_object_finalize
diff mbox series

Message ID 1531901741-8382-1-git-send-email-lidongchen@tencent.com
State New
Headers show
Series
  • [v2] migration: release MigrationIncomingState in migration_object_finalize
Related show

Commit Message

858585 jemmy July 18, 2018, 8:15 a.m. UTC
Qemu initialize the MigrationIncomingState structure in migration_object_init,
but not release it. this patch release it in migration_object_finalize.

Signed-off-by: Lidong Chen <lidongchen@tencent.com>
---
 migration/migration.c | 6 ++++++
 1 file changed, 6 insertions(+)

Patch
diff mbox series

diff --git a/migration/migration.c b/migration/migration.c
index 8d56d56930..37048d9dad 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -161,6 +161,12 @@  void migration_object_init(void)
 void migration_object_finalize(void)
 {
     object_unref(OBJECT(current_migration));
+
+    qemu_sem_destroy(&current_incoming->postcopy_pause_sem_fault);
+    qemu_sem_destroy(&current_incoming->postcopy_pause_sem_dst);
+    qemu_event_destroy(&current_incoming->main_thread_load_event);
+    qemu_mutex_destroy(&current_incoming->rp_mutex);
+    g_free(current_incoming);
 }
 
 /* For outgoing */