From 7b89bf279f16c093ed46845b8e6e0fb61b7ef639 Mon Sep 17 00:00:00 2001 From: "Dr. David Alan Gilbert" Date: Thu, 5 Nov 2015 18:10:50 +0000 Subject: Rework loadvm path for subloops Postcopy needs to have two migration streams loading concurrently; one from memory (with the device state) and the other from the fd with the memory transactions. Split the core of qemu_loadvm_state out so we can use it for both. Allow the inner loadvm loop to quit and cause the parent loops to exit as well. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela Reviewed-by: Amit Shah Signed-off-by: Juan Quintela --- migration/migration.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'migration/migration.c') diff --git a/migration/migration.c b/migration/migration.c index 295deb8a2d..e4f91a98f4 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -98,12 +98,14 @@ MigrationIncomingState *migration_incoming_state_new(QEMUFile* f) mis_current->from_src_file = f; QLIST_INIT(&mis_current->loadvm_handlers); qemu_mutex_init(&mis_current->rp_mutex); + qemu_event_init(&mis_current->main_thread_load_event, false); return mis_current; } void migration_incoming_state_destroy(void) { + qemu_event_destroy(&mis_current->main_thread_load_event); loadvm_free_handlers(mis_current); g_free(mis_current); mis_current = NULL; -- cgit v1.2.3