Blob Blame History Raw
From 21133ce1a56f6490a7ea9dd107013088c1fc05ed Mon Sep 17 00:00:00 2001
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Date: Thu, 2 Nov 2017 15:36:56 +0100
Subject: [PATCH 3/9] migration: Reset rather than destroy
 main_thread_load_event

RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-id: <20171102153657.13452-2-dgilbert@redhat.com>
Patchwork-id: 77481
O-Subject: [RHEL-7.5 qemu-kvm-rhev PATCH 1/2] migration: Reset rather than destroy main_thread_load_event
Bugzilla: 1508799
RH-Acked-by: Peter Xu <peterx@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>

From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

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>
(cherry picked from commit 5089e1862fe80b6f23ba4c494e2902cbe3d9d48e)
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
 migration/migration.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/migration/migration.c b/migration/migration.c
index 1288697..cd33718 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -172,7 +172,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)
-- 
1.8.3.1