migration: Postpone releasing MigrationState.hostname
commit83174765da3563794a56fbe24216908f3a5db194
authorPeter Xu <peterx@redhat.com>
Thu, 31 Mar 2022 15:08:39 +0000 (31 11:08 -0400)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Thu, 21 Apr 2022 18:36:46 +0000 (21 19:36 +0100)
tree830ec5c08079aaefd3df2137201f85a72c31b2c0
parent00fbe7f6add0ac58556e9fe3354d300294e6c3ef
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: Peter Xu <peterx@redhat.com>
Message-Id: <20220331150857.74406-2-peterx@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
  dgilbert: Fixup checkpatch error; don't need to check for NULL
  around g_free
migration/channel.c
migration/migration.c