diff mbox series

[06/17] migration/tls: Rename main migration channel TLS functions

Message ID 20240125162528.7552-7-avihaih@nvidia.com
State New
Headers show
Series migration: Add new migration channel connect and TLS upgrade APIs | expand

Commit Message

Avihai Horon Jan. 25, 2024, 4:25 p.m. UTC
Rename functions related to main migration channel TLS upgrade. This is
done in preparation for the next patch which will add a new TLS upgrade
API for migration channels with the same name.
No functional changes intended.

Signed-off-by: Avihai Horon <avihaih@nvidia.com>
---
 migration/tls.h        |  6 ++----
 migration/channel.c    |  2 +-
 migration/tls.c        | 24 ++++++++++--------------
 migration/trace-events |  6 +++---
 4 files changed, 16 insertions(+), 22 deletions(-)
diff mbox series

Patch

diff --git a/migration/tls.h b/migration/tls.h
index 5797d153cb..5435dd4867 100644
--- a/migration/tls.h
+++ b/migration/tls.h
@@ -32,10 +32,8 @@  QIOChannelTLS *migration_tls_client_create(QIOChannel *ioc,
                                            const char *hostname,
                                            Error **errp);
 
-void migration_tls_channel_connect(MigrationState *s,
-                                   QIOChannel *ioc,
-                                   const char *hostname,
-                                   Error **errp);
+void migration_tls_channel_connect_main(MigrationState *s, QIOChannel *ioc,
+                                        const char *hostname, Error **errp);
 
 /* Whether the QIO channel requires further TLS handshake? */
 bool migrate_channel_requires_tls_upgrade(QIOChannel *ioc);
diff --git a/migration/channel.c b/migration/channel.c
index f9de064f3b..041a63eb21 100644
--- a/migration/channel.c
+++ b/migration/channel.c
@@ -69,7 +69,7 @@  void migration_channel_connect(MigrationState *s,
 
     if (!error) {
         if (migrate_channel_requires_tls_upgrade(ioc)) {
-            migration_tls_channel_connect(s, ioc, hostname, &error);
+            migration_tls_channel_connect_main(s, ioc, hostname, &error);
 
             if (!error) {
                 /* tls_channel_connect will call back to this
diff --git a/migration/tls.c b/migration/tls.c
index fa03d9136c..803cb54c8b 100644
--- a/migration/tls.c
+++ b/migration/tls.c
@@ -98,17 +98,18 @@  void migration_tls_channel_process_incoming(MigrationState *s,
 }
 
 
-static void migration_tls_outgoing_handshake(QIOTask *task,
-                                             gpointer opaque)
+static void migration_tls_outgoing_handshake_main(QIOTask *task,
+                                                  gpointer opaque)
 {
     MigrationState *s = opaque;
     QIOChannel *ioc = QIO_CHANNEL(qio_task_get_source(task));
     Error *err = NULL;
 
     if (qio_task_propagate_error(task, &err)) {
-        trace_migration_tls_outgoing_handshake_error(error_get_pretty(err));
+        trace_migration_tls_outgoing_handshake_main_error(
+            error_get_pretty(err));
     } else {
-        trace_migration_tls_outgoing_handshake_complete();
+        trace_migration_tls_outgoing_handshake_main_complete();
     }
     migration_channel_connect(s, ioc, NULL, err);
     object_unref(OBJECT(ioc));
@@ -133,10 +134,8 @@  QIOChannelTLS *migration_tls_client_create(QIOChannel *ioc,
     return qio_channel_tls_new_client(ioc, creds, hostname, errp);
 }
 
-void migration_tls_channel_connect(MigrationState *s,
-                                   QIOChannel *ioc,
-                                   const char *hostname,
-                                   Error **errp)
+void migration_tls_channel_connect_main(MigrationState *s, QIOChannel *ioc,
+                                        const char *hostname, Error **errp)
 {
     QIOChannelTLS *tioc;
 
@@ -147,13 +146,10 @@  void migration_tls_channel_connect(MigrationState *s,
 
     /* Save hostname into MigrationState for handshake */
     s->hostname = g_strdup(hostname);
-    trace_migration_tls_outgoing_handshake_start(hostname);
+    trace_migration_tls_outgoing_handshake_main_start(hostname);
     qio_channel_set_name(QIO_CHANNEL(tioc), "migration-tls-outgoing");
-    qio_channel_tls_handshake(tioc,
-                              migration_tls_outgoing_handshake,
-                              s,
-                              NULL,
-                              NULL);
+    qio_channel_tls_handshake(tioc, migration_tls_outgoing_handshake_main, s,
+                              NULL, NULL);
 }
 
 bool migrate_channel_requires_tls_upgrade(QIOChannel *ioc)
diff --git a/migration/trace-events b/migration/trace-events
index de4a743c8a..9448b5cedf 100644
--- a/migration/trace-events
+++ b/migration/trace-events
@@ -325,9 +325,9 @@  migration_socket_outgoing_connected(const char *hostname) "hostname=%s"
 migration_socket_outgoing_error(const char *err) "error=%s"
 
 # tls.c
-migration_tls_outgoing_handshake_start(const char *hostname) "hostname=%s"
-migration_tls_outgoing_handshake_error(const char *err) "err=%s"
-migration_tls_outgoing_handshake_complete(void) ""
+migration_tls_outgoing_handshake_main_start(const char *hostname) "hostname=%s"
+migration_tls_outgoing_handshake_main_error(const char *err) "err=%s"
+migration_tls_outgoing_handshake_main_complete(void) ""
 migration_tls_incoming_handshake_start(void) ""
 migration_tls_incoming_handshake_error(const char *err) "err=%s"
 migration_tls_incoming_handshake_complete(void) ""