Skip to content
Snippets Groups Projects
Commit 83174765 authored by Peter Xu's avatar Peter Xu Committed by Dr. David Alan Gilbert
Browse files

migration: Postpone releasing MigrationState.hostname


We used to release it right after migrate_fd_connect().  That's not good
enough when there're more than one socket pair required, because it'll be
needed to establish TLS connection for the rest channels.

One example is multifd, where we copied over the hostname for each channel
but that's actually not needed.

Keeping the hostname until the cleanup phase of migration.

Cc: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: default avatarPeter Xu <peterx@redhat.com>
Message-Id: <20220331150857.74406-2-peterx@redhat.com>
Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
  dgilbert: Fixup checkpatch error; don't need to check for NULL
  around g_free
parent 00fbe7f6
No related branches found
No related tags found
No related merge requests found
......@@ -96,6 +96,5 @@ void migration_channel_connect(MigrationState *s,
}
}
migrate_fd_connect(s, error);
g_free(s->hostname);
error_free(error);
}
......@@ -1809,6 +1809,9 @@ static void migrate_fd_cleanup(MigrationState *s)
qemu_bh_delete(s->cleanup_bh);
s->cleanup_bh = NULL;
g_free(s->hostname);
s->hostname = NULL;
qemu_savevm_state_cleanup();
if (s->to_dst_file) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment