migration: Reset rather than destroy main_thread_load_event
authorDr. David Alan Gilbert <dgilbert@redhat.com>
Fri, 25 Aug 2017 14:19:39 +0000 (15:19 +0100)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Wed, 6 Sep 2017 14:18:21 +0000 (15:18 +0100)
migration_incoming_state_destroy doesn't really destroy, it cleans up.
After a loadvm it's called, but the loadvm command can be run twice,
and so destroying an init-once mutex breaks on the second loadvm.

Reported-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20170825141940.20740-2-dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Tested-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
migration/migration.c

index 1a2b3ebd1a7c3b574ba35b07ac8c47848ffdb576..9838ccc885d333f8a3f59480a48e1ed08e23f722 100644 (file)
@@ -166,7 +166,7 @@ void migration_incoming_state_destroy(void)
         mis->from_src_file = NULL;
     }
 
-    qemu_event_destroy(&mis->main_thread_load_event);
+    qemu_event_reset(&mis->main_thread_load_event);
 }
 
 static void migrate_generate_event(int new_state)