80f1615
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
80f1615
Date: Fri, 25 Aug 2017 15:19:39 +0100
80f1615
Subject: [PATCH] migration: Reset rather than destroy main_thread_load_event
80f1615
80f1615
migration_incoming_state_destroy doesn't really destroy, it cleans up.
80f1615
After a loadvm it's called, but the loadvm command can be run twice,
80f1615
and so destroying an init-once mutex breaks on the second loadvm.
80f1615
80f1615
Reported-by: Stafford Horne <shorne@gmail.com>
80f1615
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
80f1615
Message-Id: <20170825141940.20740-2-dgilbert@redhat.com>
80f1615
Reviewed-by: Peter Xu <peterx@redhat.com>
80f1615
Tested-by: Stafford Horne <shorne@gmail.com>
80f1615
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
a056f39
(cherry picked from commit 5089e1862fe80b6f23ba4c494e2902cbe3d9d48e)
80f1615
---
80f1615
 migration/migration.c | 2 +-
80f1615
 1 file changed, 1 insertion(+), 1 deletion(-)
80f1615
80f1615
diff --git a/migration/migration.c b/migration/migration.c
a056f39
index c3fe0ed9ca..a625551ce5 100644
80f1615
--- a/migration/migration.c
80f1615
+++ b/migration/migration.c
a056f39
@@ -167,7 +167,7 @@ void migration_incoming_state_destroy(void)
80f1615
         mis->from_src_file = NULL;
80f1615
     }
80f1615
 
80f1615
-    qemu_event_destroy(&mis->main_thread_load_event);
80f1615
+    qemu_event_reset(&mis->main_thread_load_event);
80f1615
 }
80f1615
 
80f1615
 static void migrate_generate_event(int new_state)