summaryrefslogtreecommitdiff
path: root/migration/migration.c
diff options
context:
space:
mode:
authorDr. David Alan Gilbert <dgilbert@redhat.com>2018-03-12 17:21:04 +0000
committerMichael S. Tsirkin <mst@redhat.com>2018-03-20 05:03:28 +0200
commit00fa4fc85b00f1a8a810068d158a7a66e88658eb (patch)
treec9b0fb8b4a92b19ca17e5167077dcadf6ba0a173 /migration/migration.c
parent2a84ffc0be7e54f2f4b76cb3ebfdde0b37bba9f0 (diff)
downloadqemu-00fa4fc85b00f1a8a810068d158a7a66e88658eb.tar.gz
postcopy: Allow registering of fd handler
Allow other userfaultfd's to be registered into the fault thread so that handlers for shared memory can get responses. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'migration/migration.c')
-rw-r--r--migration/migration.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/migration/migration.c b/migration/migration.c
index 6a4780ef6f..1f22f463d3 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -155,6 +155,8 @@ MigrationIncomingState *migration_incoming_get_current(void)
if (!once) {
mis_current.state = MIGRATION_STATUS_NONE;
memset(&mis_current, 0, sizeof(MigrationIncomingState));
+ mis_current.postcopy_remote_fds = g_array_new(FALSE, TRUE,
+ sizeof(struct PostCopyFD));
qemu_mutex_init(&mis_current.rp_mutex);
qemu_event_init(&mis_current.main_thread_load_event, false);
once = true;
@@ -177,6 +179,10 @@ void migration_incoming_state_destroy(void)
qemu_fclose(mis->from_src_file);
mis->from_src_file = NULL;
}
+ if (mis->postcopy_remote_fds) {
+ g_array_free(mis->postcopy_remote_fds, TRUE);
+ mis->postcopy_remote_fds = NULL;
+ }
qemu_event_reset(&mis->main_thread_load_event);
}