qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Chuan Zheng <zhengchuan@huawei.com>
To: <quintela@redhat.com>, <eblake@redhat.com>, <dgilbert@redhat.com>,
	<berrange@redhat.com>
Cc: zhengchuan@huawei.com, zhang.zhanghailiang@huawei.com,
	yuxiating@huawei.com, qemu-devel@nongnu.org,
	xiexiangyou@huawei.com, alex.chen@huawei.com,
	jinyan12@huawei.com
Subject: [PATCH v4 3/6] migration/tls: add tls_hostname into MultiFDSendParams
Date: Tue, 15 Sep 2020 11:03:59 +0800	[thread overview]
Message-ID: <1600139042-104593-4-git-send-email-zhengchuan@huawei.com> (raw)
In-Reply-To: <1600139042-104593-1-git-send-email-zhengchuan@huawei.com>

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>
---
 migration/multifd.c | 5 +++++
 migration/multifd.h | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/migration/multifd.c b/migration/multifd.c
index d044120..f8cd5fe 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 448a03d..8d6751f 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 */
-- 
1.8.3.1



  parent reply	other threads:[~2020-09-15  2:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-15  3:03 [PATCH v4 0/6] *** Add Multifd support for TLS migration *** Chuan Zheng
2020-09-15  3:03 ` [PATCH v4 1/6] migration/tls: save hostname into MigrationState Chuan Zheng
2020-09-15  8:21   ` Daniel P. Berrangé
2020-09-15  3:03 ` [PATCH v4 2/6] migration/tls: extract migration_tls_client_create for common-use Chuan Zheng
2020-09-15  3:03 ` Chuan Zheng [this message]
2020-09-15  8:21   ` [PATCH v4 3/6] migration/tls: add tls_hostname into MultiFDSendParams Daniel P. Berrangé
2020-09-15  3:04 ` [PATCH v4 4/6] migration/tls: extract cleanup function for common-use Chuan Zheng
2020-09-15  3:04 ` [PATCH v4 5/6] migration/tls: add support for multifd tls-handshake Chuan Zheng
2020-09-15  3:04 ` [PATCH v4 6/6] migration/tls: add trace points for multifd-tls Chuan Zheng
2020-09-24  9:03 ` [PATCH v4 0/6] *** Add Multifd support for TLS migration *** Dr. David Alan Gilbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1600139042-104593-4-git-send-email-zhengchuan@huawei.com \
    --to=zhengchuan@huawei.com \
    --cc=alex.chen@huawei.com \
    --cc=berrange@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.com \
    --cc=jinyan12@huawei.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=xiexiangyou@huawei.com \
    --cc=yuxiating@huawei.com \
    --cc=zhang.zhanghailiang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).