@@ -719,11 +719,41 @@ out:
return NULL;
}
+static bool multifd_channel_connect(MultiFDSendParams *p,
+ QIOChannel *ioc,
+ Error *error);
+
+static void multifd_tls_outgoing_handshake(QIOTask *task,
+ gpointer opaque)
+{
+ MultiFDSendParams *p = opaque;
+ QIOChannel *ioc = QIO_CHANNEL(qio_task_get_source(task));
+ Error *err = NULL;
+
+ qio_task_propagate_error(task, &err);
+ multifd_channel_connect(p, ioc, err);
+}
+
static void multifd_tls_channel_connect(MultiFDSendParams *p,
QIOChannel *ioc,
Error **errp)
{
- /* TODO */
+ MigrationState *s = p->s;
+ const char *hostname = s->hostname;
+ QIOChannelTLS *tioc;
+
+ tioc = migration_tls_client_create(s, ioc, hostname, errp);
+ if (!tioc) {
+ return;
+ }
+
+ qio_channel_set_name(QIO_CHANNEL(tioc), "multifd-tls-outgoing");
+ qio_channel_tls_handshake(tioc,
+ multifd_tls_outgoing_handshake,
+ p,
+ NULL,
+ NULL);
+
}
static bool multifd_channel_connect(MultiFDSendParams *p,