aboutsummaryrefslogtreecommitdiff
path: root/migration/migration.c
diff options
context:
space:
mode:
authorDr. David Alan Gilbert <dgilbert@redhat.com>2015-10-13 12:21:27 +0100
committerJuan Quintela <quintela@redhat.com>2015-10-15 08:12:02 +0200
commited1f3e0090069dcb9458aa9e450df12bf8eba0b0 (patch)
tree11319ac5eeb87f93fecff1cabbc7a24c869d3eb1 /migration/migration.c
parentc49d3411faae8ffaab8f7e5db47405a008411c10 (diff)
Migration: Generate the completed event only when we complete
The current migration-completed event is generated a bit too early, which means that an eager libvirt that's ready to go as soon as it sees the event ends up racing with the actual end of migration. This corresponds to RH bug: https://bugzilla.redhat.com/show_bug.cgi?id=1271145 Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Amit Shah <amit.shah@redhat.com> xSigned-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'migration/migration.c')
-rw-r--r--migration/migration.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/migration/migration.c b/migration/migration.c
index b7de9b7b3f..3d40f24556 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -294,12 +294,12 @@ static void process_incoming_migration_co(void *opaque)
migrate_decompress_threads_join();
exit(EXIT_FAILURE);
}
- migrate_generate_event(MIGRATION_STATUS_COMPLETED);
qemu_announce_self();
/* Make sure all file formats flush their mutable metadata */
bdrv_invalidate_cache_all(&local_err);
if (local_err) {
+ migrate_generate_event(MIGRATION_STATUS_FAILED);
error_report_err(local_err);
migrate_decompress_threads_join();
exit(EXIT_FAILURE);
@@ -320,6 +320,12 @@ static void process_incoming_migration_co(void *opaque)
runstate_set(global_state_get_runstate());
}
migrate_decompress_threads_join();
+ /*
+ * This must happen after any state changes since as soon as an external
+ * observer sees this event they might start to prod at the VM assuming
+ * it's ready to use.
+ */
+ migrate_generate_event(MIGRATION_STATUS_COMPLETED);
}
void process_incoming_migration(QEMUFile *f)