[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 10/17] migration/postcopy: Use the new TLS upgrade API for preemp
From: |
Avihai Horon |
Subject: |
[PATCH 10/17] migration/postcopy: Use the new TLS upgrade API for preempt channel |
Date: |
Thu, 25 Jan 2024 18:25:21 +0200 |
Use the new TLS upgrade API for postcopy preempt channel and remove old
TLS code.
Signed-off-by: Avihai Horon <avihaih@nvidia.com>
---
migration/postcopy-ram.c | 20 +++++++-------------
migration/trace-events | 1 -
2 files changed, 7 insertions(+), 14 deletions(-)
diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
index 5408e028c6..3df937e7da 100644
--- a/migration/postcopy-ram.c
+++ b/migration/postcopy-ram.c
@@ -1644,15 +1644,13 @@ postcopy_preempt_send_channel_done(MigrationState *s,
qemu_sem_post(&s->postcopy_qemufile_src_sem);
}
-static void
-postcopy_preempt_tls_handshake(QIOTask *task, gpointer opaque)
+static void postcopy_preempt_tls_handshake(QIOChannel *ioc, gpointer opaque,
+ Error *err)
{
- g_autoptr(QIOChannel) ioc = QIO_CHANNEL(qio_task_get_source(task));
MigrationState *s = opaque;
- Error *local_err = NULL;
- qio_task_propagate_error(task, &local_err);
- postcopy_preempt_send_channel_done(s, ioc, local_err);
+ postcopy_preempt_send_channel_done(s, ioc, err);
+ object_unref(ioc);
}
static void
@@ -1660,7 +1658,6 @@ postcopy_preempt_send_channel_new(QIOTask *task, gpointer
opaque)
{
g_autoptr(QIOChannel) ioc = QIO_CHANNEL(qio_task_get_source(task));
MigrationState *s = opaque;
- QIOChannelTLS *tioc;
Error *local_err = NULL;
if (qio_task_propagate_error(task, &local_err)) {
@@ -1668,14 +1665,11 @@ postcopy_preempt_send_channel_new(QIOTask *task,
gpointer opaque)
}
if (migrate_channel_requires_tls_upgrade(ioc)) {
- tioc = migration_tls_client_create(ioc, s->hostname, &local_err);
- if (!tioc) {
+ if (!migration_tls_channel_connect(ioc, "preempt", s->hostname,
+ postcopy_preempt_tls_handshake, s,
+ false, &local_err)) {
goto out;
}
- trace_postcopy_preempt_tls_handshake();
- qio_channel_set_name(QIO_CHANNEL(tioc), "migration-tls-preempt");
- qio_channel_tls_handshake(tioc, postcopy_preempt_tls_handshake,
- s, NULL, NULL);
/* Setup the channel until TLS handshake finished */
return;
}
diff --git a/migration/trace-events b/migration/trace-events
index 2c328326e8..9a8ec67115 100644
--- a/migration/trace-events
+++ b/migration/trace-events
@@ -297,7 +297,6 @@ postcopy_request_shared_page(const char *sharer, const char
*rb, uint64_t rb_off
postcopy_request_shared_page_present(const char *sharer, const char *rb,
uint64_t rb_offset) "%s already %s offset 0x%"PRIx64
postcopy_wake_shared(uint64_t client_addr, const char *rb) "at 0x%"PRIx64" in
%s"
postcopy_page_req_del(void *addr, int count) "resolved page req %p total %d"
-postcopy_preempt_tls_handshake(void) ""
postcopy_preempt_new_channel(void) ""
postcopy_preempt_thread_entry(void) ""
postcopy_preempt_thread_exit(void) ""
--
2.26.3
- [PATCH 00/17] migration: Add new migration channel connect and TLS upgrade APIs, Avihai Horon, 2024/01/25
- [PATCH 01/17] migration: Fix logic of channels and transport compatibility check, Avihai Horon, 2024/01/25
- [PATCH 02/17] migration: Move local_err check in migration_ioc_process_incoming(), Avihai Horon, 2024/01/25
- [PATCH 03/17] migration: Rename default_channel to main_channel, Avihai Horon, 2024/01/25
- [PATCH 10/17] migration/postcopy: Use the new TLS upgrade API for preempt channel,
Avihai Horon <=
- [PATCH 11/17] migration/tls: Make migration_tls_client_create() static, Avihai Horon, 2024/01/25
- [PATCH 12/17] migration/multifd: Consolidate TLS/non-TLS multifd channel error flow, Avihai Horon, 2024/01/25
- [PATCH 04/17] migration/multifd: Set p->running = true in the right place, Avihai Horon, 2024/01/25
- Re: [PATCH 04/17] migration/multifd: Set p->running = true in the right place, Fabiano Rosas, 2024/01/25
- Re: [PATCH 04/17] migration/multifd: Set p->running = true in the right place, Avihai Horon, 2024/01/28
- Re: [PATCH 04/17] migration/multifd: Set p->running = true in the right place, Peter Xu, 2024/01/28
- Re: [PATCH 04/17] migration/multifd: Set p->running = true in the right place, Avihai Horon, 2024/01/29
- Re: [PATCH 04/17] migration/multifd: Set p->running = true in the right place, Peter Xu, 2024/01/30
- Re: [PATCH 04/17] migration/multifd: Set p->running = true in the right place, Avihai Horon, 2024/01/30
- Re: [PATCH 04/17] migration/multifd: Set p->running = true in the right place, Fabiano Rosas, 2024/01/29