aboutsummaryrefslogtreecommitdiff
path: root/migration
diff options
context:
space:
mode:
authorChuan Zheng <zhengchuan@huawei.com>2020-09-15 11:03:59 +0800
committerDr. David Alan Gilbert <dgilbert@redhat.com>2020-09-25 12:45:58 +0100
commit8e5fa059328643affe1cdb269f3f5ae1a52fe7ac (patch)
tree62120e41f94731d1fc6cba86594b1c7cf11b8e3f /migration
parentbfb790e7b2bbbc19686cf6bc3b03742b8361ac82 (diff)
migration/tls: add tls_hostname into MultiFDSendParams
Since multifd creation is async with migration_channel_connect, we should pass the hostname from MigrationState to MultiFDSendParams. Signed-off-by: Chuan Zheng <zhengchuan@huawei.com> Signed-off-by: Yan Jin <jinyan12@huawei.com> Message-Id: <1600139042-104593-4-git-send-email-zhengchuan@huawei.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'migration')
-rw-r--r--migration/multifd.c5
-rw-r--r--migration/multifd.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/migration/multifd.c b/migration/multifd.c
index fd57378db8..de34276c43 100644
--- a/migration/multifd.c
+++ b/migration/multifd.c
@@ -548,6 +548,8 @@ void multifd_save_cleanup(void)
qemu_sem_destroy(&p->sem_sync);
g_free(p->name);
p->name = NULL;
+ g_free(p->tls_hostname);
+ p->tls_hostname = NULL;
multifd_pages_clear(p->pages);
p->pages = NULL;
p->packet_len = 0;
@@ -751,10 +753,12 @@ int multifd_save_setup(Error **errp)
int thread_count;
uint32_t page_count = MULTIFD_PACKET_SIZE / qemu_target_page_size();
uint8_t i;
+ MigrationState *s;
if (!migrate_use_multifd()) {
return 0;
}
+ s = migrate_get_current();
thread_count = migrate_multifd_channels();
multifd_send_state = g_malloc0(sizeof(*multifd_send_state));
multifd_send_state->params = g_new0(MultiFDSendParams, thread_count);
@@ -779,6 +783,7 @@ int multifd_save_setup(Error **errp)
p->packet->magic = cpu_to_be32(MULTIFD_MAGIC);
p->packet->version = cpu_to_be32(MULTIFD_VERSION);
p->name = g_strdup_printf("multifdsend_%d", i);
+ p->tls_hostname = g_strdup(s->hostname);
socket_send_channel_create(multifd_new_send_channel_async, p);
}
diff --git a/migration/multifd.h b/migration/multifd.h
index 448a03d89a..8d6751f5ed 100644
--- a/migration/multifd.h
+++ b/migration/multifd.h
@@ -71,6 +71,8 @@ typedef struct {
uint8_t id;
/* channel thread name */
char *name;
+ /* tls hostname */
+ char *tls_hostname;
/* channel thread id */
QemuThread thread;
/* communication channel */