From nobody Sat May 18 21:16:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=quarantine dis=quarantine) header.from=huawei.com ARC-Seal: i=1; a=rsa-sha256; t=1673876989; cv=none; d=zohomail.com; s=zohoarc; b=apBk3IuQ7lGs2V+wwlT2AGj+0eyLNNV1kPnUGytk1pgtSS518wZE0bG5Pi7NnCd6YUypwi0ucHfDov5p4O93scxd5oMKgKgqEad4JUqDVrATHdqlwCeJP7FBeLTPrrWxq1BIUvfovKDpzYt1wTp6qjXAg0dG8b8g7SNUaV3oYrA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673876989; 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=Cx7PBgjJeh5hR7x86p4A+WlmZMRce1ErrPHEBingo8c=; b=BYh/Gk47uuaBBVSgLrPtLLBl051EyFi6otivUHjs9EWUckzGVWxi7zWkeL6bpEj0/CXRILa/04EFo4J8/FR4cz4b3kKJvjTmiOtIQVKd8zwO2CbnrQSTAtNv3Yzp01/nKJxINUyLrYonWVU4Bdbn3yuy4ftXXX1FDRK6iOh2fhs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=quarantine dis=quarantine) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 167387698928641.95676140849571; Mon, 16 Jan 2023 05:49:49 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-322--gsi-V4kO3yeGpU51vldbA-1; Mon, 16 Jan 2023 08:49:44 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 669668828C8; Mon, 16 Jan 2023 13:49:42 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 53B282166B26; Mon, 16 Jan 2023 13:49:42 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3A3B4194658D; Mon, 16 Jan 2023 13:49:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3731F1946589 for ; Mon, 16 Jan 2023 13:49:41 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 29B5F1415126; Mon, 16 Jan 2023 13:49:41 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 21BB314171B8 for ; Mon, 16 Jan 2023 13:49:41 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0600D857D0D for ; Mon, 16 Jan 2023 13:49:41 +0000 (UTC) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-365-9blgwKiON2OUecxjJOIf4g-1; Mon, 16 Jan 2023 08:49:37 -0500 Received: from dggpeml500022.china.huawei.com (unknown [172.30.72.56]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4NwYHm544Rz16NH6 for ; Mon, 16 Jan 2023 21:47:48 +0800 (CST) Received: from localhost.localdomain (10.175.124.27) by dggpeml500022.china.huawei.com (7.185.36.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 16 Jan 2023 21:49:29 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673876988; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Cx7PBgjJeh5hR7x86p4A+WlmZMRce1ErrPHEBingo8c=; b=aO9AUly3PSVb76XHPMLOVfuBZgsMBnQ8h83+T/nRWrNq17YXvsAilbrdArALqbNzc4fkjy uXumHsog+Yna4/xXtwkJO5Oneax7QtI//nvpBfxuKLcNYZkxNTPqPOnhuXkmahqgHrvQEn b5vZwWs0OyVE3DZKOJ0vRA4BgiMmH5U= X-MC-Unique: -gsi-V4kO3yeGpU51vldbA-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: 9blgwKiON2OUecxjJOIf4g-1 From: Jiang Jiacheng To: Subject: [PATCH 1/3] Add public API for parallel compression method Date: Mon, 16 Jan 2023 21:42:29 +0800 Message-ID: <20230116134231.2977373-2-jiangjiacheng@huawei.com> In-Reply-To: <20230116134231.2977373-1-jiangjiacheng@huawei.com> References: <20230116134231.2977373-1-jiangjiacheng@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml500022.china.huawei.com (7.185.36.66) X-CFilter-Loop: Reflected X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: yubihong@huawei.com, zhengchuan@huawei.com, linyilu@huawei.com, jiangjiacheng@huawei.com, xiexiangyou@huawei.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1673876991342100003 Content-Type: text/plain; charset="utf-8" Add public API VIR_MIGRATE_PARAM_PARALLEL_COMPRESSION, VIR_MIGRATE_PARAM_PARALLEL_ZLIB_LEVEL, VIR_MIGRATE_PARAM_PARALLEL_ZSTD_LEVEL for migration APIs to support set compression method and compress level used during migration. Signed-off-by: Jiang Jiacheng --- include/libvirt/libvirt-domain.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-dom= ain.h index 5152ed4551..981f4e5160 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -1351,6 +1351,36 @@ typedef enum { */ # define VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS "parallel.connections" =20 +/** + * VIR_MIGRATE_PARAM_PARALLEL_COMPRESSION: + * + * virDomainMigrate* params field: compression method used during parallel + * migration. As VIR_TYPED_PARAM_INT. + * + * Since: 9.1.0 + */ +# define VIR_MIGRATE_PARAM_PARALLEL_COMPRESSION "parallel.compression" + +/** + * VIR_MIGRATE_PARAM_PARALLEL_ZLIB_LEVEL: + * + * virDomainMigrate* params field: zlib compress level used during parallel + * migration. As VIR_TYPED_PARAM_INT. + * + * Since: 9.1.0 + */ +# define VIR_MIGRATE_PARAM_PARALLEL_ZLIB_LEVEL "parallel.zlib.level" + +/** + * VIR_MIGRATE_PARAM_PARALLEL_ZSTD_LEVEL: + * + * virDomainMigrate* params field: zstd compress level used during parallel + * migration. As VIR_TYPED_PARAM_INT. + * + * Since: 9.1.0 + */ +# define VIR_MIGRATE_PARAM_PARALLEL_ZSTD_LEVEL "parallel.zstd.level" + /** * VIR_MIGRATE_PARAM_TLS_DESTINATION: * --=20 2.33.0 From nobody Sat May 18 21:16:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=quarantine dis=quarantine) header.from=huawei.com ARC-Seal: i=1; a=rsa-sha256; t=1673877003; cv=none; d=zohomail.com; s=zohoarc; b=l38Zp5Dg0nYxJXoxP9a9fLhjhwesnpgv7TVxLbB1TH9TsZqkd3kCXBCLM5BYJlcU+nCchr4SaA+WLXEb3Co4JKb5G2gjJrevl1pSQ1ujfmHAAEEDBpZQuk50WF6BmUhRS9A2aLs9p2xCT09afNccx/SkUDbD67M5nEqNKFtNfcM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673877003; 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=vOvmjsgtmLsNXDJjIAVQopIywUeq1HFbfg20A6mMTzM=; b=NzSS5nh0DSlLxy8plbPiXxTErEsJ45kXySxijie2EI3WD9J7t+No6xwvT00VOpufkhOnh75clqAFFfIRoRIZ8Qke95aYEox0022cj3hyxk9WhZPhy+yT3rR0hLmTaT0mJzk3aBlcXXPQ4uj6ALL+Mb4n9D+UvsCe6md/f9JbokM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=quarantine dis=quarantine) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 167387700379454.55358545326851; Mon, 16 Jan 2023 05:50:03 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-425-8KSFoo1tO5KtDCXIiJPrpg-1; Mon, 16 Jan 2023 08:49:50 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D17E28030A0; Mon, 16 Jan 2023 13:49:47 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id BF1702026D68; Mon, 16 Jan 2023 13:49:47 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B2FF1194658C; Mon, 16 Jan 2023 13:49:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D8224194658D for ; Mon, 16 Jan 2023 13:49:40 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id ADC432026F70; Mon, 16 Jan 2023 13:49:40 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast07.extmail.prod.ext.rdu2.redhat.com [10.11.55.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A66DF2026D76 for ; Mon, 16 Jan 2023 13:49:40 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8674D3C10681 for ; Mon, 16 Jan 2023 13:49:40 +0000 (UTC) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-22-CzQ3oMnJM5eXvTV46QP5wA-1; Mon, 16 Jan 2023 08:49:38 -0500 Received: from dggpeml500022.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NwYHm2ZlGznVvR for ; Mon, 16 Jan 2023 21:47:48 +0800 (CST) Received: from localhost.localdomain (10.175.124.27) by dggpeml500022.china.huawei.com (7.185.36.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 16 Jan 2023 21:49:30 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673877002; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=vOvmjsgtmLsNXDJjIAVQopIywUeq1HFbfg20A6mMTzM=; b=De+7fkncpjz2+pUmePQ/1MFiCHRudsP3XoSpDcYZuTa75kj5QkWm8Xwbl2x943jcZGNX7Y 2Q+cqTp7CyC+FxdZsmMI+GdynLZpp35j3Zur/dlj+ece6d3LUSZ5n4tpZd/Q81zk8rcJXQ LXmWFvCZzmR0cLF2BM6riZKK2Q6Kinw= X-MC-Unique: 8KSFoo1tO5KtDCXIiJPrpg-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: CzQ3oMnJM5eXvTV46QP5wA-1 From: Jiang Jiacheng To: Subject: [PATCH 2/3] qemu: Add qemu parallel migration parameters Date: Mon, 16 Jan 2023 21:42:30 +0800 Message-ID: <20230116134231.2977373-3-jiangjiacheng@huawei.com> In-Reply-To: <20230116134231.2977373-1-jiangjiacheng@huawei.com> References: <20230116134231.2977373-1-jiangjiacheng@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml500022.china.huawei.com (7.185.36.66) X-CFilter-Loop: Reflected X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: yubihong@huawei.com, zhengchuan@huawei.com, linyilu@huawei.com, jiangjiacheng@huawei.com, xiexiangyou@huawei.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1673877005500100007 Content-Type: text/plain; charset="utf-8" Add qemu migration parameters to support setting multifd migration compression method and level. Those parameters has been supportted by QEMU since 5.0. Signed-off-by: Jiang Jiacheng --- src/qemu/qemu_migration.h | 3 +++ src/qemu/qemu_migration_params.c | 29 ++++++++++++++++++++++++++++- src/qemu/qemu_migration_params.h | 3 +++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_migration.h b/src/qemu/qemu_migration.h index d21b6f67e8..c099eb8356 100644 --- a/src/qemu/qemu_migration.h +++ b/src/qemu/qemu_migration.h @@ -86,6 +86,9 @@ VIR_MIGRATE_PARAM_AUTO_CONVERGE_INCREMENT, VIR_TYPED_PARAM_INT, \ VIR_MIGRATE_PARAM_BANDWIDTH_POSTCOPY, VIR_TYPED_PARAM_ULLONG, \ VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS, VIR_TYPED_PARAM_INT, \ + VIR_MIGRATE_PARAM_PARALLEL_COMPRESSION, VIR_TYPED_PARAM_STRING, \ + VIR_MIGRATE_PARAM_PARALLEL_ZLIB_LEVEL, VIR_TYPED_PARAM_INT, \ + VIR_MIGRATE_PARAM_PARALLEL_ZSTD_LEVEL, VIR_TYPED_PARAM_INT, \ VIR_MIGRATE_PARAM_TLS_DESTINATION, VIR_TYPED_PARAM_STRING, \ VIR_MIGRATE_PARAM_DISKS_URI, VIR_TYPED_PARAM_STRING, \ NULL diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_par= ams.c index bd09dcfb23..6b68214083 100644 --- a/src/qemu/qemu_migration_params.c +++ b/src/qemu/qemu_migration_params.c @@ -114,6 +114,9 @@ VIR_ENUM_IMPL(qemuMigrationParam, "xbzrle-cache-size", "max-postcopy-bandwidth", "multifd-channels", + "multifd-compression", + "multifd-zlib-level", + "multifd-zstd-level", ); =20 typedef struct _qemuMigrationParamsAlwaysOnItem qemuMigrationParamsAlwaysO= nItem; @@ -225,6 +228,18 @@ static const qemuMigrationParamsTPMapItem qemuMigratio= nParamsTPMap[] =3D { .param =3D QEMU_MIGRATION_PARAM_MULTIFD_CHANNELS, .party =3D QEMU_MIGRATION_SOURCE | QEMU_MIGRATION_DESTINATION}, =20 + {.typedParam =3D VIR_MIGRATE_PARAM_PARALLEL_COMPRESSION, + .param =3D QEMU_MIGRATION_PARAM_MULTIFD_COMPRESSION, + .party =3D QEMU_MIGRATION_SOURCE | QEMU_MIGRATION_DESTINATION}, + + {.typedParam =3D VIR_MIGRATE_PARAM_PARALLEL_ZLIB_LEVEL, + .param =3D QEMU_MIGRATION_PARAM_MULTIFD_ZLIB_LEVEL, + .party =3D QEMU_MIGRATION_SOURCE | QEMU_MIGRATION_DESTINATION}, + + {.typedParam =3D VIR_MIGRATE_PARAM_PARALLEL_ZSTD_LEVEL, + .param =3D QEMU_MIGRATION_PARAM_MULTIFD_ZSTD_LEVEL, + .party =3D QEMU_MIGRATION_SOURCE | QEMU_MIGRATION_DESTINATION}, + {.typedParam =3D VIR_MIGRATE_PARAM_TLS_DESTINATION, .param =3D QEMU_MIGRATION_PARAM_TLS_HOSTNAME, .party =3D QEMU_MIGRATION_SOURCE}, @@ -271,6 +286,15 @@ static const qemuMigrationParamInfoItem qemuMigrationP= aramInfo[] =3D { [QEMU_MIGRATION_PARAM_MULTIFD_CHANNELS] =3D { .type =3D QEMU_MIGRATION_PARAM_TYPE_INT, }, + [QEMU_MIGRATION_PARAM_MULTIFD_COMPRESSION] =3D { + .type =3D QEMU_MIGRATION_PARAM_TYPE_STRING, + }, + [QEMU_MIGRATION_PARAM_MULTIFD_ZLIB_LEVEL] =3D { + .type =3D QEMU_MIGRATION_PARAM_TYPE_INT, + }, + [QEMU_MIGRATION_PARAM_MULTIFD_ZSTD_LEVEL] =3D { + .type =3D QEMU_MIGRATION_PARAM_TYPE_INT, + }, }; G_STATIC_ASSERT(G_N_ELEMENTS(qemuMigrationParamInfo) =3D=3D QEMU_MIGRATION= _PARAM_LAST); =20 @@ -662,7 +686,10 @@ qemuMigrationParamsFromFlags(virTypedParameterPtr para= ms, return NULL; } =20 - if (migParams->params[QEMU_MIGRATION_PARAM_MULTIFD_CHANNELS].set && + if ((migParams->params[QEMU_MIGRATION_PARAM_MULTIFD_CHANNELS].set || + migParams->params[QEMU_MIGRATION_PARAM_MULTIFD_COMPRESSION].set || + migParams->params[QEMU_MIGRATION_PARAM_MULTIFD_ZLIB_LEVEL].set || + migParams->params[QEMU_MIGRATION_PARAM_MULTIFD_ZSTD_LEVEL].set) && !(flags & VIR_MIGRATE_PARALLEL)) { virReportError(VIR_ERR_INVALID_ARG, "%s", _("Turn parallel migration on to tune it")); diff --git a/src/qemu/qemu_migration_params.h b/src/qemu/qemu_migration_par= ams.h index e7c65f6a21..5857673227 100644 --- a/src/qemu/qemu_migration_params.h +++ b/src/qemu/qemu_migration_params.h @@ -59,6 +59,9 @@ typedef enum { QEMU_MIGRATION_PARAM_XBZRLE_CACHE_SIZE, QEMU_MIGRATION_PARAM_MAX_POSTCOPY_BANDWIDTH, QEMU_MIGRATION_PARAM_MULTIFD_CHANNELS, + QEMU_MIGRATION_PARAM_MULTIFD_COMPRESSION, + QEMU_MIGRATION_PARAM_MULTIFD_ZLIB_LEVEL, + QEMU_MIGRATION_PARAM_MULTIFD_ZSTD_LEVEL, =20 QEMU_MIGRATION_PARAM_LAST } qemuMigrationParam; --=20 2.33.0 From nobody Sat May 18 21:16:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=quarantine dis=quarantine) header.from=huawei.com ARC-Seal: i=1; a=rsa-sha256; t=1673877003; cv=none; d=zohomail.com; s=zohoarc; b=LRQkC/8lR0cb2j1mroBPd6nXNEObE5FPoOeDKeFPMdiFV3U2HH1WyGs+XPnrNWaKVxPtWHaJ1UWiI8HnwU3Ar9peHcG9kL7ogZbVkiB7fWJ7kqJkvpWZP9K+eGEz4EdgVGIaI4jOTPPSJPFd6wswLJpM2HZB8C7EfKLsHeBrPCo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673877003; 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=uFRaIagvSCm7MJ4cTB0M9H3nqudm8nYiDsnLbdXTDNQ=; b=PTYZvxJXQC97/EtQrWSDjU5Hfoo8z+6YB2H/MozHc1iuBIhzNnKBTZS3jyWI9H6Zp08LDT2chzIqz5q7Ge6wDujDNzrDPP6tizz9iQQeYRlx+y15y6cc99Hno8olNT52UjT5NkGh3nDWnshhblQW+GXaDkMVkeiVzjNkNghPvZI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=quarantine dis=quarantine) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1673877003132159.17049987648068; Mon, 16 Jan 2023 05:50:03 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-42-RJwiPv8iMj2hFTeRBtRx3Q-1; Mon, 16 Jan 2023 08:49:43 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6351E18E004B; Mon, 16 Jan 2023 13:49:41 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6456DC15BA0; Mon, 16 Jan 2023 13:49:40 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2FD60194658C; Mon, 16 Jan 2023 13:49:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9AB401946589 for ; Mon, 16 Jan 2023 13:49:38 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 660C253AA; Mon, 16 Jan 2023 13:49:38 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5E19951FF for ; Mon, 16 Jan 2023 13:49:38 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3E67A8828C2 for ; Mon, 16 Jan 2023 13:49:38 +0000 (UTC) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-641-BFliOl9KPNmjv83qdOgiTA-1; Mon, 16 Jan 2023 08:49:35 -0500 Received: from dggpeml500022.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NwYJ84mfyzJql2 for ; Mon, 16 Jan 2023 21:48:08 +0800 (CST) Received: from localhost.localdomain (10.175.124.27) by dggpeml500022.china.huawei.com (7.185.36.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 16 Jan 2023 21:49:30 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673877002; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=uFRaIagvSCm7MJ4cTB0M9H3nqudm8nYiDsnLbdXTDNQ=; b=AcOPsuAgXYZ0U+q3LSaIQ4jfhqWvpixAdCFw8B5sUcaOTq5hHTVvRG603FLvuy1ulPOlvj UBKB2qkwXB/DK9cqdv+5VDOGLdI1Sz/RH7pPdd705DLfDPEL5hv7A7r1ZZftLrrn2TGC8+ TPkpqamqdNPnVfuBqB7xyH7JcgcdLb0= X-MC-Unique: RJwiPv8iMj2hFTeRBtRx3Q-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: BFliOl9KPNmjv83qdOgiTA-1 From: Jiang Jiacheng To: Subject: [PATCH 3/3] virsh: Add options for multifd migration compression Date: Mon, 16 Jan 2023 21:42:31 +0800 Message-ID: <20230116134231.2977373-4-jiangjiacheng@huawei.com> In-Reply-To: <20230116134231.2977373-1-jiangjiacheng@huawei.com> References: <20230116134231.2977373-1-jiangjiacheng@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml500022.china.huawei.com (7.185.36.66) X-CFilter-Loop: Reflected X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: yubihong@huawei.com, zhengchuan@huawei.com, linyilu@huawei.com, jiangjiacheng@huawei.com, xiexiangyou@huawei.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1673877003401100001 Content-Type: text/plain; charset="utf-8" Add multifd migration options: --parallel-compression --parallel-zlib-level --parallel-zstd-level Signed-off-by: Jiang Jiacheng --- docs/manpages/virsh.rst | 11 +++++++++-- tools/virsh-domain.c | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index 88b7fa1da8..0024c80317 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -3359,7 +3359,8 @@ migrate [--comp-xbzrle-cache] [--auto-converge] [auto-converge-initial] [auto-converge-increment] [--persistent-xml file] [--tls] [--postcopy-bandwidth bandwidth] - [--parallel [--parallel-connections connections]] + [--parallel [--parallel-connections connections] + [--parallel-compression] [--parallel-zlib-level][--parallel-zstd-lev= el]] [--bandwidth bandwidth] [--tls-destination hostname] [--disks-uri URI] [--copy-storage-synchronous-writes] =20 @@ -3486,7 +3487,13 @@ starting the migration. parallel connections. The number of such connections can be set using *--parallel-connections*. Parallel connections may help with saturating the network link between the source and the target and thus speeding up the -migration. +migration. *--parallel-compression* sets the method of compression use +in multifd migration, supported choice are "none", "zlib" and "zstd" and +is set to "none" by default. *--parallel-zlib-level* sets the compression +level when using "zlib" as multifd migration's compression mesthod. Values +are in range from 0 to 9 and defaults to 1. *--parallel-zstd-level* sets +the compression level when using "zstd" as multifd migration's compression +mesthod. Values are in range from 0 to 20 and defaults to 1. =20 Running migration can be canceled by interrupting virsh (usually using ``Ctrl-C``) or by ``domjobabort`` command sent from another virsh instance. diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 6b431bd1e5..2f2b3eba0c 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -11095,6 +11095,18 @@ static const vshCmdOptDef opts_migrate[] =3D { .type =3D VSH_OT_INT, .help =3D N_("number of connections for parallel migration") }, + {.name =3D "parallel-compression", + .type =3D VSH_OT_STRING, + .help =3D N_("compress method for parallel migration") + }, + {.name =3D "parallel-zlib-level", + .type =3D VSH_OT_INT, + .help =3D N_("zlib compression level used in parallel migration") + }, + {.name =3D "parallel-zstd-level", + .type =3D VSH_OT_INT, + .help =3D N_("zstd compression level used in parallel migration") + }, {.name =3D "bandwidth", .type =3D VSH_OT_INT, .help =3D N_("migration bandwidth limit in MiB/s") @@ -11326,6 +11338,33 @@ doMigrate(void *opaque) goto save_error; } =20 + if (vshCommandOptStringReq(ctl, cmd, "parallel-compression", &opt) < 0) + goto out; + if (opt) { + if (virTypedParamsAddString(¶ms, &nparams, &maxparams, + VIR_MIGRATE_PARAM_PARALLEL_COMPRESSION, + opt) < 0) + goto save_error; + } + + if ((rv =3D vshCommandOptInt(ctl, cmd, "parallel-zlib-level", &intOpt)= ) < 0) { + goto out; + } else if (rv > 0) { + if (virTypedParamsAddInt(¶ms, &nparams, &maxparams, + VIR_MIGRATE_PARAM_PARALLEL_ZLIB_LEVEL, + intOpt) < 0) + goto save_error; + } + + if ((rv =3D vshCommandOptInt(ctl, cmd, "parallel-zstd-level", &intOpt)= ) < 0) { + goto out; + } else if (rv > 0) { + if (virTypedParamsAddInt(¶ms, &nparams, &maxparams, + VIR_MIGRATE_PARAM_PARALLEL_ZSTD_LEVEL, + intOpt) < 0) + goto save_error; + } + if ((rv =3D vshCommandOptULongLong(ctl, cmd, "bandwidth", &ullOpt)) < = 0) { goto out; } else if (rv > 0) { --=20 2.33.0