From nobody Wed May 1 23:11:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1600138470; cv=none; d=zohomail.com; s=zohoarc; b=jHob3POOkODZQw9Hr8B2jcIIolzQxxvst+MX3aEi7kl3jxN6i9MCnzohJFGGLk/rU4+/InkSDApRRPaNf/urSvVnTih2b3KsVVBDsosm/OHuogEudr7EHDmUhhZUPVPGHBG5c43a9YjiaKKBiuaAKENluhtQRdA45HpMUI0AQRI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600138470; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=cxArY3/3njrDpYrjYg24HvmQoAnzCXsQp/JJqHhAwU0=; b=k4DROWARbHTXuL++yTWS+9U+bD0wKu7ldY+VDcDKD+3u7BktF4DC/eJW47IzMV3LbguK1u75oKrnP/w/ZOaJxzkiSa9TjfxcqdiYfdhb1/cYCkfKIrCz+159ZcYs1mHx9Q5R+OAp6Q9L/aGLtRL8SKrvtdBY/31Gtz4/AMw010I= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1600138470329760.395746934494; Mon, 14 Sep 2020 19:54:30 -0700 (PDT) Received: from localhost ([::1]:56848 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kI16z-0000yR-7w for importer@patchew.org; Mon, 14 Sep 2020 22:54:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44288) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI15j-0007pF-3n for qemu-devel@nongnu.org; Mon, 14 Sep 2020 22:53:11 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:4698 helo=huawei.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI15g-0003WP-L2 for qemu-devel@nongnu.org; Mon, 14 Sep 2020 22:53:10 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 27CAB74E4C91BB214747; Tue, 15 Sep 2020 10:53:04 +0800 (CST) Received: from huawei.com (10.175.101.6) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Tue, 15 Sep 2020 10:52:57 +0800 From: Chuan Zheng To: , , , Subject: [PATCH v4 1/6] migration/tls: save hostname into MigrationState Date: Tue, 15 Sep 2020 11:03:57 +0800 Message-ID: <1600139042-104593-2-git-send-email-zhengchuan@huawei.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1600139042-104593-1-git-send-email-zhengchuan@huawei.com> References: <1600139042-104593-1-git-send-email-zhengchuan@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-CFilter-Loop: Reflected Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=45.249.212.190; envelope-from=zhengchuan@huawei.com; helo=huawei.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/14 22:53:05 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" hostname is need in multifd-tls, save hostname into MigrationState. Signed-off-by: Chuan Zheng Signed-off-by: Yan Jin Reviewed-by: Daniel P. Berrang=C3=A9 --- migration/channel.c | 1 + migration/migration.c | 1 + migration/migration.h | 5 +++++ migration/tls.c | 2 ++ 4 files changed, 9 insertions(+) diff --git a/migration/channel.c b/migration/channel.c index 20e4c8e..8a783ba 100644 --- a/migration/channel.c +++ b/migration/channel.c @@ -90,5 +90,6 @@ void migration_channel_connect(MigrationState *s, } } migrate_fd_connect(s, error); + g_free(s->hostname); error_free(error); } diff --git a/migration/migration.c b/migration/migration.c index 58a5452..e20b778 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1883,6 +1883,7 @@ void migrate_init(MigrationState *s) s->migration_thread_running =3D false; error_free(s->error); s->error =3D NULL; + s->hostname =3D NULL; =20 migrate_set_state(&s->state, MIGRATION_STATUS_NONE, MIGRATION_STATUS_S= ETUP); =20 diff --git a/migration/migration.h b/migration/migration.h index bdc7450..bc96322 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -259,6 +259,11 @@ struct MigrationState * (which is in 4M chunk). */ uint8_t clear_bitmap_shift; + + /* + * This save hostname when out-going migration starts + */ + char *hostname; }; =20 void migrate_set_state(int *state, int old_state, int new_state); diff --git a/migration/tls.c b/migration/tls.c index 7a02ec8..8fbf9ac 100644 --- a/migration/tls.c +++ b/migration/tls.c @@ -154,6 +154,8 @@ void migration_tls_channel_connect(MigrationState *s, return; } =20 + /* Save hostname into MigrationState for handshake */ + s->hostname =3D g_strdup(hostname); trace_migration_tls_outgoing_handshake_start(hostname); qio_channel_set_name(QIO_CHANNEL(tioc), "migration-tls-outgoing"); qio_channel_tls_handshake(tioc, --=20 1.8.3.1 From nobody Wed May 1 23:11:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1600138472; cv=none; d=zohomail.com; s=zohoarc; b=aEpnyikFYGs16bPdcFOI5GPvfeUewpqTCIccfBgn3UH7V1fAC0nDQMY4EHXwHSCZlWjsJVCvl1kdtC7flKIm4zfeUlog2XkN0CGW6HKYow8QPxpFlhJx5UJ/cPr5mUIQuICtKNmVgDuBFWlIThaM5EGxDMCNXoKf408J6k/JYwc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600138472; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=eEhppJABFRwIZ1f50oYToRMJ83bE/qh+sxCOItp4PZg=; b=bLkbCt/q6fhiLqpWy0f1yYYageVSniXaQ+OP3GBGAt4yaTkVOJSNGOKaAsBFq5i1ZuqSfgymNLZcMz73QdijwXK/luYKjZqEoglkSGWSYCmGhTekFRstJytluoanshzRmx6qCc7rGHvVFt+JnGzkxLy67h89V5mMiqoGfKQtweU= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1600138472867744.2478861684124; Mon, 14 Sep 2020 19:54:32 -0700 (PDT) Received: from localhost ([::1]:57110 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kI171-00014t-Mm for importer@patchew.org; Mon, 14 Sep 2020 22:54:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44298) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI15j-0007q7-Qy for qemu-devel@nongnu.org; Mon, 14 Sep 2020 22:53:11 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:4695 helo=huawei.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI15g-0003WQ-L3 for qemu-devel@nongnu.org; Mon, 14 Sep 2020 22:53:11 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 1D641A7C557C28109592; Tue, 15 Sep 2020 10:53:04 +0800 (CST) Received: from huawei.com (10.175.101.6) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Tue, 15 Sep 2020 10:52:57 +0800 From: Chuan Zheng To: , , , Subject: [PATCH v4 2/6] migration/tls: extract migration_tls_client_create for common-use Date: Tue, 15 Sep 2020 11:03:58 +0800 Message-ID: <1600139042-104593-3-git-send-email-zhengchuan@huawei.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1600139042-104593-1-git-send-email-zhengchuan@huawei.com> References: <1600139042-104593-1-git-send-email-zhengchuan@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.175.101.6] X-CFilter-Loop: Reflected Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=45.249.212.190; envelope-from=zhengchuan@huawei.com; helo=huawei.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/14 22:53:05 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" migration_tls_client_create will be used in multifd-tls, let's extract it. Signed-off-by: Chuan Zheng Signed-off-by: Yan Jin Reviewed-by: Daniel P. Berrang=C3=A9 --- migration/tls.c | 26 ++++++++++++++++++-------- migration/tls.h | 6 ++++++ 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/migration/tls.c b/migration/tls.c index 8fbf9ac..66c6f43 100644 --- a/migration/tls.c +++ b/migration/tls.c @@ -22,7 +22,6 @@ #include "channel.h" #include "migration.h" #include "tls.h" -#include "io/channel-tls.h" #include "crypto/tlscreds.h" #include "qemu/error-report.h" #include "qapi/error.h" @@ -125,11 +124,10 @@ static void migration_tls_outgoing_handshake(QIOTask = *task, object_unref(OBJECT(ioc)); } =20 - -void migration_tls_channel_connect(MigrationState *s, - QIOChannel *ioc, - const char *hostname, - Error **errp) +QIOChannelTLS *migration_tls_client_create(MigrationState *s, + QIOChannel *ioc, + const char *hostname, + Error **errp) { QCryptoTLSCreds *creds; QIOChannelTLS *tioc; @@ -137,7 +135,7 @@ void migration_tls_channel_connect(MigrationState *s, creds =3D migration_tls_get_creds( s, QCRYPTO_TLS_CREDS_ENDPOINT_CLIENT, errp); if (!creds) { - return; + return NULL; } =20 if (s->parameters.tls_hostname && *s->parameters.tls_hostname) { @@ -145,11 +143,23 @@ void migration_tls_channel_connect(MigrationState *s, } if (!hostname) { error_setg(errp, "No hostname available for TLS"); - return; + return NULL; } =20 tioc =3D qio_channel_tls_new_client( ioc, creds, hostname, errp); + + return tioc; +} + +void migration_tls_channel_connect(MigrationState *s, + QIOChannel *ioc, + const char *hostname, + Error **errp) +{ + QIOChannelTLS *tioc; + + tioc =3D migration_tls_client_create(s, ioc, hostname, errp); if (!tioc) { return; } diff --git a/migration/tls.h b/migration/tls.h index cdd7000..0cfbe36 100644 --- a/migration/tls.h +++ b/migration/tls.h @@ -22,11 +22,17 @@ #define QEMU_MIGRATION_TLS_H =20 #include "io/channel.h" +#include "io/channel-tls.h" =20 void migration_tls_channel_process_incoming(MigrationState *s, QIOChannel *ioc, Error **errp); =20 +QIOChannelTLS *migration_tls_client_create(MigrationState *s, + QIOChannel *ioc, + const char *hostname, + Error **errp); + void migration_tls_channel_connect(MigrationState *s, QIOChannel *ioc, const char *hostname, --=20 1.8.3.1 From nobody Wed May 1 23:11:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1600138512; cv=none; d=zohomail.com; s=zohoarc; b=lkuY7UXYuprcgKljg8qI3R72rareo5MEKwSXts8O0WctbbVh/V3SYrCzkw96tsA/q7cSDXKIa6KwjBiSjOpzANEq4lHfBWWej5LPz2/WjC2xIxyBY6lMVUrhF+ggTVXLd/35gv2nsueHdJE9kd04K+2Bc3j62eU6ciASZieNEoo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600138512; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=hhKls/0fCxYRq6BlOYKnstB/gpKa9oWV7QWBHYhHRDQ=; b=lZcgwwwwCOW3pRs+RtvJHthcfucAdtGMzs3OtTGGqRmKGbmOL0V2sdiiZ+3nmWKkt9xaaL+Z3XuPWARuBymsYxxhETJgOMCdwK25b2T5jIq5gv8bkDOtuQPhIE6k7do3BS3F8WZDbQTGjrPYLViNom3Iz+eclTMW2SC4u0b/oNI= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1600138512619437.99020738620095; Mon, 14 Sep 2020 19:55:12 -0700 (PDT) Received: from localhost ([::1]:60848 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kI17f-0002Zc-IJ for importer@patchew.org; Mon, 14 Sep 2020 22:55:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44314) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI15k-0007r6-PQ for qemu-devel@nongnu.org; Mon, 14 Sep 2020 22:53:12 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:4697 helo=huawei.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI15g-0003WR-L5 for qemu-devel@nongnu.org; Mon, 14 Sep 2020 22:53:12 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 45F4FE96C1B94AFEE44C; Tue, 15 Sep 2020 10:53:04 +0800 (CST) Received: from huawei.com (10.175.101.6) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Tue, 15 Sep 2020 10:52:58 +0800 From: Chuan Zheng To: , , , Subject: [PATCH v4 3/6] migration/tls: add tls_hostname into MultiFDSendParams Date: Tue, 15 Sep 2020 11:03:59 +0800 Message-ID: <1600139042-104593-4-git-send-email-zhengchuan@huawei.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1600139042-104593-1-git-send-email-zhengchuan@huawei.com> References: <1600139042-104593-1-git-send-email-zhengchuan@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-CFilter-Loop: Reflected Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=45.249.212.190; envelope-from=zhengchuan@huawei.com; helo=huawei.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/14 22:53:05 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Since multifd creation is async with migration_channel_connect, we should pass the hostname from MigrationState to MultiFDSendParams. Signed-off-by: Chuan Zheng Signed-off-by: Yan Jin Reviewed-by: Daniel P. Berrang=C3=A9 --- 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 =3D NULL; + g_free(p->tls_hostname); + p->tls_hostname =3D NULL; multifd_pages_clear(p->pages); p->pages =3D NULL; p->packet_len =3D 0; @@ -751,10 +753,12 @@ int multifd_save_setup(Error **errp) int thread_count; uint32_t page_count =3D MULTIFD_PACKET_SIZE / qemu_target_page_size(); uint8_t i; + MigrationState *s; =20 if (!migrate_use_multifd()) { return 0; } + s =3D migrate_get_current(); thread_count =3D migrate_multifd_channels(); multifd_send_state =3D g_malloc0(sizeof(*multifd_send_state)); multifd_send_state->params =3D g_new0(MultiFDSendParams, thread_count); @@ -779,6 +783,7 @@ int multifd_save_setup(Error **errp) p->packet->magic =3D cpu_to_be32(MULTIFD_MAGIC); p->packet->version =3D cpu_to_be32(MULTIFD_VERSION); p->name =3D g_strdup_printf("multifdsend_%d", i); + p->tls_hostname =3D g_strdup(s->hostname); socket_send_channel_create(multifd_new_send_channel_async, p); } =20 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 */ --=20 1.8.3.1 From nobody Wed May 1 23:11:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1600138649; cv=none; d=zohomail.com; s=zohoarc; b=AfLLa2MS2P6lHnrQfnIetpIauJOiYu6XHHKJ7yHCXf0U8g+792C2XvLnOW7N/6MkuO+4wrJYX2XOW4nEQ6hBLs8DJNrc1ONfpcdxZ9aGui9/kFKnyuPhkxmr/XvEFI4+E40AWPktJlcD6G/mlk5OFLrMIiWcaYJnh2vN1JtDLo8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600138649; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=pmogjnS4wb2pzbL6MI+qDemPoFMJEW1xxlx32iqa6WY=; b=Fye6/HlgO7WupHGVznQbBzrAmLbBKijyCNSAIP6psWyQkbuuKE+svQme6Tvp6z55tlTtPzZpMaJFEwvgS5/P5ZO9pki1Nnb/MHIFSurKCAKP1W5ya2qveRarDND3MZP0xXSaFkyankV//BIhmZ1ltg0Aaha1uYjTg+y7QQhvsyo= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1600138649155313.97980862299846; Mon, 14 Sep 2020 19:57:29 -0700 (PDT) Received: from localhost ([::1]:40310 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kI19r-0005r8-Vb for importer@patchew.org; Mon, 14 Sep 2020 22:57:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44350) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI15n-0007ww-SW for qemu-devel@nongnu.org; Mon, 14 Sep 2020 22:53:15 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:55524 helo=huawei.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI15k-0003Xy-5x for qemu-devel@nongnu.org; Mon, 14 Sep 2020 22:53:15 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 2E1A2A61EEA571337037; Tue, 15 Sep 2020 10:53:09 +0800 (CST) Received: from huawei.com (10.175.101.6) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Tue, 15 Sep 2020 10:52:58 +0800 From: Chuan Zheng To: , , , Subject: [PATCH v4 4/6] migration/tls: extract cleanup function for common-use Date: Tue, 15 Sep 2020 11:04:00 +0800 Message-ID: <1600139042-104593-5-git-send-email-zhengchuan@huawei.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1600139042-104593-1-git-send-email-zhengchuan@huawei.com> References: <1600139042-104593-1-git-send-email-zhengchuan@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.175.101.6] X-CFilter-Loop: Reflected Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=45.249.212.32; envelope-from=zhengchuan@huawei.com; helo=huawei.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/14 21:28:41 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" multifd channel cleanup is need if multifd handshake failed, let's extract it. Signed-off-by: Chuan Zheng Signed-off-by: Yan Jin Reviewed-by: Daniel P. Berrang=C3=A9 --- migration/multifd.c | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/migration/multifd.c b/migration/multifd.c index f8cd5fe..24c468a 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -719,6 +719,23 @@ out: return NULL; } =20 +static void multifd_new_send_channel_cleanup(MultiFDSendParams *p, + QIOChannel *ioc, Error *err) +{ + migrate_set_error(migrate_get_current(), err); + /* Error happen, we need to tell who pay attention to me */ + qemu_sem_post(&multifd_send_state->channels_ready); + qemu_sem_post(&p->sem_sync); + /* + * Although multifd_send_thread is not created, but main migration + * thread neet to judge whether it is running, so we need to mark + * its status. + */ + p->quit =3D true; + object_unref(OBJECT(ioc)); + error_free(err); +} + static void multifd_new_send_channel_async(QIOTask *task, gpointer opaque) { MultiFDSendParams *p =3D opaque; @@ -727,25 +744,18 @@ static void multifd_new_send_channel_async(QIOTask *t= ask, gpointer opaque) =20 trace_multifd_new_send_channel_async(p->id); if (qio_task_propagate_error(task, &local_err)) { - migrate_set_error(migrate_get_current(), local_err); - /* Error happen, we need to tell who pay attention to me */ - qemu_sem_post(&multifd_send_state->channels_ready); - qemu_sem_post(&p->sem_sync); - /* - * Although multifd_send_thread is not created, but main migration - * thread neet to judge whether it is running, so we need to mark - * its status. - */ - p->quit =3D true; - object_unref(OBJECT(sioc)); - error_free(local_err); + goto cleanup; } else { p->c =3D QIO_CHANNEL(sioc); qio_channel_set_delay(p->c, false); p->running =3D true; qemu_thread_create(&p->thread, p->name, multifd_send_thread, p, QEMU_THREAD_JOINABLE); + return; } + +cleanup: + multifd_new_send_channel_cleanup(p, sioc, local_err); } =20 int multifd_save_setup(Error **errp) --=20 1.8.3.1 From nobody Wed May 1 23:11:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1600138584; cv=none; d=zohomail.com; s=zohoarc; b=Z6z4AFmUvMD8GTKjgHhhVC7osGkf2VRy/EV+4E3/vQv5mp0gTPKExM+9FbSUvZWB3SRL8+QqPiwqKqFMXgwlshi0trwspQrAelKm5r5daJB8L/ngJ0Qlzg5wZlX+XkEVbUhP+FZ1btTBfmvy8Lut7XI7euW4pcu5VeoIa4eSeMY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600138584; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kBYCpZPJ3QlL3eL8Sp6Z8BmhOD77lm6z+d4gwJYPlEw=; b=m2uRC+yZyySsh+fu3inv0mvhxzNmSEFx7eSSjeBtcN1T6DyB9ry8OcGKCMp16fKloWYzjok5AGJq32ebgMe3SIEJ4ItTdQyJwpFbqxJjptpek3gwZtCCFzQyCe2ML2q5RdL9HpPcYftzIBZ3qY3QP/djpD0wgqdGHFN6LpFTH24= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1600138584684868.5197072904538; Mon, 14 Sep 2020 19:56:24 -0700 (PDT) Received: from localhost ([::1]:36214 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kI18p-00048K-Kk for importer@patchew.org; Mon, 14 Sep 2020 22:56:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44344) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI15l-0007tF-W9 for qemu-devel@nongnu.org; Mon, 14 Sep 2020 22:53:14 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:55548 helo=huawei.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI15k-0003Xz-7N for qemu-devel@nongnu.org; Mon, 14 Sep 2020 22:53:13 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 340456D7D04F4E59C54F; Tue, 15 Sep 2020 10:53:09 +0800 (CST) Received: from huawei.com (10.175.101.6) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Tue, 15 Sep 2020 10:52:59 +0800 From: Chuan Zheng To: , , , Subject: [PATCH v4 5/6] migration/tls: add support for multifd tls-handshake Date: Tue, 15 Sep 2020 11:04:01 +0800 Message-ID: <1600139042-104593-6-git-send-email-zhengchuan@huawei.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1600139042-104593-1-git-send-email-zhengchuan@huawei.com> References: <1600139042-104593-1-git-send-email-zhengchuan@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.175.101.6] X-CFilter-Loop: Reflected Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=45.249.212.32; envelope-from=zhengchuan@huawei.com; helo=huawei.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/14 21:28:41 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Similar like migration main thread, we need to do handshake for each multifd thread. Signed-off-by: Chuan Zheng Signed-off-by: Yan Jin Reviewed-by: Daniel P. Berrang=C3=A9 --- migration/multifd.c | 77 +++++++++++++++++++++++++++++++++++++++++++++++++= ++-- 1 file changed, 75 insertions(+), 2 deletions(-) diff --git a/migration/multifd.c b/migration/multifd.c index 24c468a..3325c66 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -20,6 +20,7 @@ #include "ram.h" #include "migration.h" #include "socket.h" +#include "tls.h" #include "qemu-file.h" #include "trace.h" #include "multifd.h" @@ -719,6 +720,77 @@ out: return NULL; } =20 +static bool multifd_channel_connect(MultiFDSendParams *p, + QIOChannel *ioc, + Error *error); + +static void multifd_tls_outgoing_handshake(QIOTask *task, + gpointer opaque) +{ + MultiFDSendParams *p =3D opaque; + QIOChannel *ioc =3D QIO_CHANNEL(qio_task_get_source(task)); + Error *err =3D 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) +{ + MigrationState *s =3D migrate_get_current(); + const char *hostname =3D p->tls_hostname; + QIOChannelTLS *tioc; + + tioc =3D 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, + QIOChannel *ioc, + Error *error) +{ + MigrationState *s =3D migrate_get_current(); + + if (!error) { + if (s->parameters.tls_creds && + *s->parameters.tls_creds && + !object_dynamic_cast(OBJECT(ioc), + TYPE_QIO_CHANNEL_TLS)) { + multifd_tls_channel_connect(p, ioc, &error); + if (!error) { + /* + * tls_channel_connect will call back to this + * function after the TLS handshake, + * so we mustn't call multifd_send_thread until then + */ + return false; + } else { + return true; + } + } else { + /* update for tls qio channel */ + p->c =3D ioc; + qemu_thread_create(&p->thread, p->name, multifd_send_thread, p, + QEMU_THREAD_JOINABLE); + } + return false; + } + + return true; +} + static void multifd_new_send_channel_cleanup(MultiFDSendParams *p, QIOChannel *ioc, Error *err) { @@ -749,8 +821,9 @@ static void multifd_new_send_channel_async(QIOTask *tas= k, gpointer opaque) p->c =3D QIO_CHANNEL(sioc); qio_channel_set_delay(p->c, false); p->running =3D true; - qemu_thread_create(&p->thread, p->name, multifd_send_thread, p, - QEMU_THREAD_JOINABLE); + if (multifd_channel_connect(p, sioc, local_err)) { + goto cleanup; + } return; } =20 --=20 1.8.3.1 From nobody Wed May 1 23:11:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1600138474; cv=none; d=zohomail.com; s=zohoarc; b=RJZ1muCJSxQAuXxHp90bzjXmeWM8nsWLz53Nq+FFiF24f3qkSjlVjg0HSh0LBK50jUujYGaLnSZS6eNRIwzRUkr6ijZK5v8cTcN5zYJoJpCEQJhAdKBptM4zqOP1XeTK97lfRTZ53Sbv3NwhjdVG+DYvs2+ZRU8JKsGN4NuVyVg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600138474; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ROYQGjHyVHcAs8hA2bFzFuEw2+Ja0frYguh8rhMZ6D8=; b=N37VygA4LW49H+C0ZIlWVCyWkuaSoucegnbgtP5ygzLUxulSlQIyckpCLqHzRmeiFF0W7GgcCraEt7JBNn69Jw3S2eovGK0nPPqYVOytdxXcV9HuVoalZQ0xWONkUquC/RAgug1GzVxYbd1YGN0Bb1fgp7ighpRpEuK37SYb2sA= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1600138474257877.8239154388917; Mon, 14 Sep 2020 19:54:34 -0700 (PDT) Received: from localhost ([::1]:57246 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kI173-000185-4g for importer@patchew.org; Mon, 14 Sep 2020 22:54:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44348) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI15m-0007ui-SJ for qemu-devel@nongnu.org; Mon, 14 Sep 2020 22:53:14 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:55552 helo=huawei.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI15l-0003Y0-0a for qemu-devel@nongnu.org; Mon, 14 Sep 2020 22:53:14 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 39CC6B1EA352625E235A; Tue, 15 Sep 2020 10:53:09 +0800 (CST) Received: from huawei.com (10.175.101.6) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Tue, 15 Sep 2020 10:53:00 +0800 From: Chuan Zheng To: , , , Subject: [PATCH v4 6/6] migration/tls: add trace points for multifd-tls Date: Tue, 15 Sep 2020 11:04:02 +0800 Message-ID: <1600139042-104593-7-git-send-email-zhengchuan@huawei.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1600139042-104593-1-git-send-email-zhengchuan@huawei.com> References: <1600139042-104593-1-git-send-email-zhengchuan@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.175.101.6] X-CFilter-Loop: Reflected Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=45.249.212.32; envelope-from=zhengchuan@huawei.com; helo=huawei.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/14 21:28:41 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" add trace points for multifd-tls for debug. Signed-off-by: Chuan Zheng Signed-off-by: Yan Jin Reviewed-by: Daniel P. Berrang=C3=A9 --- migration/multifd.c | 10 +++++++++- migration/trace-events | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/migration/multifd.c b/migration/multifd.c index 3325c66..6f36e8c 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -731,7 +731,11 @@ static void multifd_tls_outgoing_handshake(QIOTask *ta= sk, QIOChannel *ioc =3D QIO_CHANNEL(qio_task_get_source(task)); Error *err =3D NULL; =20 - qio_task_propagate_error(task, &err); + if (qio_task_propagate_error(task, &err)) { + trace_multifd_tls_outgoing_handshake_error(ioc, error_get_pretty(e= rr)); + } else { + trace_multifd_tls_outgoing_handshake_complete(ioc); + } multifd_channel_connect(p, ioc, err); } =20 @@ -748,6 +752,7 @@ static void multifd_tls_channel_connect(MultiFDSendPara= ms *p, return; } =20 + trace_multifd_tls_outgoing_handshake_start(ioc, tioc, hostname); qio_channel_set_name(QIO_CHANNEL(tioc), "multifd-tls-outgoing"); qio_channel_tls_handshake(tioc, multifd_tls_outgoing_handshake, @@ -763,6 +768,9 @@ static bool multifd_channel_connect(MultiFDSendParams *= p, { MigrationState *s =3D migrate_get_current(); =20 + trace_multifd_set_outgoing_channel( + ioc, object_get_typename(OBJECT(ioc)), p->tls_hostname, error); + if (!error) { if (s->parameters.tls_creds && *s->parameters.tls_creds && diff --git a/migration/trace-events b/migration/trace-events index 7ba2fa6..6b5a053 100644 --- a/migration/trace-events +++ b/migration/trace-events @@ -129,6 +129,10 @@ multifd_send_sync_main_wait(uint8_t id) "channel %d" multifd_send_terminate_threads(bool error) "error %d" multifd_send_thread_end(uint8_t id, uint64_t packets, uint64_t pages) "cha= nnel %d packets %" PRIu64 " pages %" PRIu64 multifd_send_thread_start(uint8_t id) "%d" +multifd_tls_outgoing_handshake_start(void *ioc, void *tioc, const char *ho= stname) "ioc=3D%p tioc=3D%p hostname=3D%s" +multifd_tls_outgoing_handshake_error(void *ioc, const char *err) "ioc=3D%p= err=3D%s" +multifd_tls_outgoing_handshake_complete(void *ioc) "ioc=3D%p" +multifd_set_outgoing_channel(void *ioc, const char *ioctype, const char *h= ostname, void *err) "ioc=3D%p ioctype=3D%s hostname=3D%s err=3D%p" =20 # migration.c await_return_path_close_on_source_close(void) "" --=20 1.8.3.1