[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 10/18] migration: Postpone releasing MigrationState.hostname
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[PULL 10/18] migration: Postpone releasing MigrationState.hostname |
Date: |
Thu, 21 Apr 2022 17:40:35 +0100 |
From: Peter Xu <peterx@redhat.com>
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>
---
migration/channel.c | 1 -
migration/migration.c | 5 +++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/migration/channel.c b/migration/channel.c
index c4fc000a1a..c6a8dcf1d7 100644
--- a/migration/channel.c
+++ b/migration/channel.c
@@ -96,6 +96,5 @@ void migration_channel_connect(MigrationState *s,
}
}
migrate_fd_connect(s, error);
- g_free(s->hostname);
error_free(error);
}
diff --git a/migration/migration.c b/migration/migration.c
index 4dcb511bb6..90676f3f22 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1809,6 +1809,11 @@ static void migrate_fd_cleanup(MigrationState *s)
qemu_bh_delete(s->cleanup_bh);
s->cleanup_bh = NULL;
+ if (s->hostname) {
+ g_free(s->hostname);
+ s->hostname = NULL;
+ }
+
qemu_savevm_state_cleanup();
if (s->to_dst_file) {
--
2.35.1
- [PULL 00/18] migration queue, Dr. David Alan Gilbert (git), 2022/04/21
- [PULL 02/18] tests: support QTEST_TRACE env variable, Dr. David Alan Gilbert (git), 2022/04/21
- [PULL 07/18] tests: introduce ability to provide hooks for migration precopy test, Dr. David Alan Gilbert (git), 2022/04/21
- [PULL 01/18] tests: improve error message when saving TLS PSK file fails, Dr. David Alan Gilbert (git), 2022/04/21
- [PULL 03/18] tests: print newline after QMP response in qtest logs, Dr. David Alan Gilbert (git), 2022/04/21
- [PULL 04/18] migration: fix use of TLS PSK credentials with a UNIX socket, Dr. David Alan Gilbert (git), 2022/04/21
- [PULL 06/18] tests: merge code for UNIX and TCP migration pre-copy tests, Dr. David Alan Gilbert (git), 2022/04/21
- [PULL 09/18] tests: expand the migration precopy helper to support failures, Dr. David Alan Gilbert (git), 2022/04/21
- [PULL 10/18] migration: Postpone releasing MigrationState.hostname,
Dr. David Alan Gilbert (git) <=
- [PULL 08/18] tests: switch migration FD passing test to use common precopy helper, Dr. David Alan Gilbert (git), 2022/04/21
- [PULL 05/18] tests: switch MigrateStart struct to be stack allocated, Dr. David Alan Gilbert (git), 2022/04/21
- [PULL 11/18] migration: Drop multifd tls_hostname cache, Dr. David Alan Gilbert (git), 2022/04/21
- [PULL 13/18] migration: Move migrate_allow_multifd and helpers into migration.c, Dr. David Alan Gilbert (git), 2022/04/21
- [PULL 16/18] migration: Allow migrate-recover to run multiple times, Dr. David Alan Gilbert (git), 2022/04/21
- [PULL 14/18] migration: Export ram_load_postcopy(), Dr. David Alan Gilbert (git), 2022/04/21
- [PULL 18/18] migration: Read state once, Dr. David Alan Gilbert (git), 2022/04/21
- [PULL 12/18] migration: Add pss.postcopy_requested status, Dr. David Alan Gilbert (git), 2022/04/21
- [PULL 15/18] migration: Move channel setup out of postcopy_try_recover(), Dr. David Alan Gilbert (git), 2022/04/21
- [PULL 17/18] migration: Fix operator type, Dr. David Alan Gilbert (git), 2022/04/21