diff mbox series

[v1,6/7] migration/tls: add support for multifd tls-handshake

Message ID 1599663177-53993-7-git-send-email-zhengchuan@huawei.com (mailing list archive)
State New, archived
Headers show
Series *** Add Multifd support for TLS migration *** | expand

Commit Message

Zheng Chuan Sept. 9, 2020, 2:52 p.m. UTC
add support for multifd tls-handshake

Signed-off-by: Chuan Zheng <zhengchuan@huawei.com>
Signed-off-by: Yan Jin <jinyan12@huawei.com>
---
 migration/multifd.c | 32 +++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)

Comments

Daniel P. Berrangé Sept. 10, 2020, 1:25 p.m. UTC | #1
On Wed, Sep 09, 2020 at 10:52:56PM +0800, Chuan Zheng wrote:
> add support for multifd tls-handshake
> 
> Signed-off-by: Chuan Zheng <zhengchuan@huawei.com>
> Signed-off-by: Yan Jin <jinyan12@huawei.com>
> ---
>  migration/multifd.c | 32 +++++++++++++++++++++++++++++++-
>  1 file changed, 31 insertions(+), 1 deletion(-)
> 
> diff --git a/migration/multifd.c b/migration/multifd.c
> index b2076d7..2509187 100644
> --- a/migration/multifd.c
> +++ b/migration/multifd.c
> @@ -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);
> +
>  }


Please squash this back into the previous patch, and both are
inter-dependant on each other, and thus don't make sense to split

Assuming it is squashed in

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>



Regards,
Daniel
Zheng Chuan Sept. 10, 2020, 1:56 p.m. UTC | #2
On 2020/9/10 21:25, Daniel P. Berrangé wrote:
> On Wed, Sep 09, 2020 at 10:52:56PM +0800, Chuan Zheng wrote:
>> add support for multifd tls-handshake
>>
>> Signed-off-by: Chuan Zheng <zhengchuan@huawei.com>
>> Signed-off-by: Yan Jin <jinyan12@huawei.com>
>> ---
>>  migration/multifd.c | 32 +++++++++++++++++++++++++++++++-
>>  1 file changed, 31 insertions(+), 1 deletion(-)
>>
>> diff --git a/migration/multifd.c b/migration/multifd.c
>> index b2076d7..2509187 100644
>> --- a/migration/multifd.c
>> +++ b/migration/multifd.c
>> @@ -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);
>> +
>>  }
> 
> 
> Please squash this back into the previous patch, and both are
> inter-dependant on each other, and thus don't make sense to split
> 
> Assuming it is squashed in
> 
> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
> 
OK, will squash it in v2
> 
> 
> Regards,
> Daniel
>
diff mbox series

Patch

diff --git a/migration/multifd.c b/migration/multifd.c
index b2076d7..2509187 100644
--- a/migration/multifd.c
+++ b/migration/multifd.c
@@ -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,