From nobody Sat May 18 23:55:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1674204966; cv=none; d=zohomail.com; s=zohoarc; b=MUh8yMywzXsRVAUdDoPDpwrS84WGvqxvadef2jWajNl5nux556yDAbUOa85Fc11z3dT3zGAJB5BU6X6xJtqAlH1XZqQMwDYOSQmjw5NUIk2MxFSCseowgVcN4OTh2vdDu6u0yzjLoZvKFjQTGGRupI96Lr9lmOzFZRm2FSiyRyc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674204966; 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=At/Gl3xXB8rXqt36vk38F0B411QM+BAT5g8PRmWwb5M=; b=K8/K8BWsKXW4G689wfonpsPHxQIA+hAHK7PFEKfUG7TzKAxeZzgLUG6oOhxHzctYtS7gBcNbYBrkFKnkkc6lebarCkyQY+nklzIAra/8MVmK0+J0CaYKu/uqIrIW8t6EGzWR9kUpdJEAp6RBXvGVVSwHp6hIDCGapAnjY17gASA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1674204966379792.0704694691829; Fri, 20 Jan 2023 00:56:06 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-602-0o_soMMDPwWN16Pihtaavw-1; Fri, 20 Jan 2023 03:55:10 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B70991C189B0; Fri, 20 Jan 2023 08:55:08 +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 C502B1121318; Fri, 20 Jan 2023 08:55:06 +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 94D8D1946A6E; Fri, 20 Jan 2023 08:55:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C550D1946A6D for ; Fri, 20 Jan 2023 08:55:05 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B278B1121315; Fri, 20 Jan 2023 08:55:05 +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 AB60E1121318 for ; Fri, 20 Jan 2023 08:55:05 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.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 8CEEB857A88 for ; Fri, 20 Jan 2023 08:55:05 +0000 (UTC) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-56-41UawXiGNXWYPAO2m4Kj1w-1; Fri, 20 Jan 2023 03:55:03 -0500 Received: from dggpeml500022.china.huawei.com (unknown [172.30.72.55]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4NytW70yjWzJqpQ for ; Fri, 20 Jan 2023 16:50:43 +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; Fri, 20 Jan 2023 16:54:59 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674204965; 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=At/Gl3xXB8rXqt36vk38F0B411QM+BAT5g8PRmWwb5M=; b=NuuFn8uI1/fs54hbqA7d413Dbl5B/qzI+BxojP/KEqY8pViJsc1HALK1is+0AMhe5YXMNf 0AWK3MvrEiqNtbjI3MB9hlTEzzOod5L+s7DbMa2L8IGKSJzAHLNM008EMwCvgxCqiAUZWK oCEk50KrrTMaSu3Byub/hhiDlzSB0nY= X-MC-Unique: 0o_soMMDPwWN16Pihtaavw-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: 41UawXiGNXWYPAO2m4Kj1w-1 From: Jiang Jiacheng To: Subject: [PATCH 1/4] Add public API for parallel compression method Date: Fri, 20 Jan 2023 16:47:40 +0800 Message-ID: <20230120084743.825806-2-jiangjiacheng@huawei.com> In-Reply-To: <20230120084743.825806-1-jiangjiacheng@huawei.com> References: <20230120084743.825806-1-jiangjiacheng@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) 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.3 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.3 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: 1674204967001100005 Content-Type: text/plain; charset="utf-8" Add description for VIR_MIGRATE_PARAM_COMPRESSION, it will be reused in choosing compression method during multifd migration. Add public API VIR_MIGRATE_PARAM_COMPRESSION_ZLIB_LEVEL, VIR_MIGRATE_PARAM_COMPRESSION_ZSTD_LEVEL for migration APIs to support set compress level during multifd migration. Signed-off-by: Jiang Jiacheng --- include/libvirt/libvirt-domain.h | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-dom= ain.h index 5152ed4551..deac3687ed 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -1271,7 +1271,9 @@ typedef enum { * virDomainMigrate* params multiple field: name of the method used to * compress migration traffic. Supported compression methods: xbzrle, mt. * The parameter may be specified multiple times if more than one method - * should be used. + * should be used. Support compression methods for multifd migration: zlib, + * zstd. When using with multifd migration, only one supported compression + * method can be specified. * * Since: 1.3.4 */ @@ -1351,6 +1353,26 @@ typedef enum { */ # define VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS "parallel.connections" =20 +/** + * VIR_MIGRATE_PARAM_COMPRESSION_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_COMPRESSION_ZLIB_LEVEL "compression.zlib.l= evel" + +/** + * VIR_MIGRATE_PARAM_COMPRESSION_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_COMPRESSION_ZSTD_LEVEL "compression.zstd.l= evel" + /** * VIR_MIGRATE_PARAM_TLS_DESTINATION: * --=20 2.33.0 From nobody Sat May 18 23:55:34 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=1674204964; cv=none; d=zohomail.com; s=zohoarc; b=GOpJHfx1PWqkdnweUEWsOI2mcTNGdIye3Oh9ebEJmbDF+GTIG65xSG8IvnXYkbXwJnVooAudJ9bC0CU+0HlaQFPaYYWWcdvsTGyZ+7A3N6q0f4y8LBSBJZ2fw7DaT07CTiEt/xlsb0G4M/O4JzUDJSyLrfoSprpVYx1JOrip6k8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674204964; 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=VbkA1svLbZq6RkliqziAoiHmbO09kleCYza1xiHF0JM=; b=Ue4auBrOk+3C//0kVRzpxheamte+6W+hoPQgXQs/gryeQov9HVvP4R4eZmx2KA44zYJyu8a4DyDhWrHbL6Tx4tO/0SB4KZ7IGRfaGRJW5V62U7cZQB78t+c9IOfHSwVC7VGytelXrwofoJan9ha3kJ8cCEXf6KHbTCVjsJYubd4= 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 1674204964576677.0129109600776; Fri, 20 Jan 2023 00:56:04 -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-602-4nFEb2tdMbeayi5XU26QUw-1; Fri, 20 Jan 2023 03:55:10 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B82728021B6; Fri, 20 Jan 2023 08:55:08 +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 4239540C2064; Fri, 20 Jan 2023 08:55:08 +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 D6FF81946A76; Fri, 20 Jan 2023 08:55:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A48BC1946A78 for ; Fri, 20 Jan 2023 08:55:06 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 8A4C81121315; Fri, 20 Jan 2023 08:55:06 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast09.extmail.prod.ext.rdu2.redhat.com [10.11.55.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 82A2B1121318 for ; Fri, 20 Jan 2023 08:55:06 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.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 6A489293248B for ; Fri, 20 Jan 2023 08:55:06 +0000 (UTC) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-108-776cvHIdOFK-a_TVD69bhQ-1; Fri, 20 Jan 2023 03:55:03 -0500 Received: from dggpeml500022.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4NytW73x1RzJqqV for ; Fri, 20 Jan 2023 16:50:43 +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; Fri, 20 Jan 2023 16:55:00 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674204963; 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=VbkA1svLbZq6RkliqziAoiHmbO09kleCYza1xiHF0JM=; b=IuCwE1bHaWDn2VCuzVMB11ZYHEpnVAbs+nO6sP08lR36KTwIi6hcnU1amHqxO5OsIbIAxA CgtC9F1lC4Rsfh82rbzQVRoysIgNvj3ZsXk0Gx7hsGeeCb/J/MhcFwrrG89AwRrDLtmCz/ dnMkqJ55i6BrTAbBiJrXKHoBATQhJt8= X-MC-Unique: 4nFEb2tdMbeayi5XU26QUw-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: 776cvHIdOFK-a_TVD69bhQ-1 From: Jiang Jiacheng To: Subject: [PATCH 2/4] qemu: Add qemu parallel migration parameters Date: Fri, 20 Jan 2023 16:47:41 +0800 Message-ID: <20230120084743.825806-3-jiangjiacheng@huawei.com> In-Reply-To: <20230120084743.825806-1-jiangjiacheng@huawei.com> References: <20230120084743.825806-1-jiangjiacheng@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) 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.3 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.1 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: 1674204964984100001 Content-Type: text/plain; charset="utf-8" Add qemu migration parameters to support setting multifd migration compression method and level. Signed-off-by: Jiang Jiacheng --- src/qemu/qemu_migration.h | 2 ++ src/qemu/qemu_migration_params.c | 24 +++++++++++++++++++++++- src/qemu/qemu_migration_params.h | 3 +++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_migration.h b/src/qemu/qemu_migration.h index d21b6f67e8..ed62fd4a91 100644 --- a/src/qemu/qemu_migration.h +++ b/src/qemu/qemu_migration.h @@ -86,6 +86,8 @@ 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_COMPRESSION_ZLIB_LEVEL, VIR_TYPED_PARAM_INT, \ + VIR_MIGRATE_PARAM_COMPRESSION_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..380fc7dccd 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,14 @@ 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_COMPRESSION_ZLIB_LEVEL, + .param =3D QEMU_MIGRATION_PARAM_MULTIFD_ZLIB_LEVEL, + .party =3D QEMU_MIGRATION_SOURCE | QEMU_MIGRATION_DESTINATION}, + + {.typedParam =3D VIR_MIGRATE_PARAM_COMPRESSION_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 +282,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 +682,9 @@ qemuMigrationParamsFromFlags(virTypedParameterPtr param= s, 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_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 23:55:34 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=1674204914; cv=none; d=zohomail.com; s=zohoarc; b=DXc6j3QMdZ1BwnvRqaGNy7bd14KBE1wnjx629XLxW/YfqTksoqICq6PDilVzkxwoDo294mHHT3q5rG0IQnY/UavznWoAZWAWOvIqaxhBjza/sFEeKqLpPn/XPySkZCosnqmtdJvvG+7mQBaZGfWROBbOsI3CV8LA8qv/YSg6Owc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674204914; 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=Jbj596iCNoVtI3FvCwhSY+ucp2lkQKumFUKk8FhYtbQ=; b=cvyAYEQFQyLAkR4Wr6EhN19QQwh7kZTfyDIkMvSusw0sx5U6+LKgx2MmWAROJm9IACQl03ux8Ah+kguWgrP3R8eAVIndWRb52Sjv6ulEQhC9d+lezWcURWS8Hi/ZOzXR+/Gipmf7pC8NlSokX4L/5IjSTttNvVSncuBPR9YCb+E= 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 1674204914659217.0317583290821; Fri, 20 Jan 2023 00:55:14 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-500-rhQdDB0POf2MqFq3bPYHsA-1; Fri, 20 Jan 2023 03:55:10 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E033729324B5; Fri, 20 Jan 2023 08:55:08 +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 C93F040C2064; Fri, 20 Jan 2023 08:55:08 +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 1A32B1947051; Fri, 20 Jan 2023 08:55:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 32B491946A6D for ; Fri, 20 Jan 2023 08:55:07 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 2539F492C3F; Fri, 20 Jan 2023 08:55:07 +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 1E0DF492C3E for ; Fri, 20 Jan 2023 08:55:07 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.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 F3D268533DF for ; Fri, 20 Jan 2023 08:55:06 +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-198-UTvBLqVpN-KOjdMIRlco9A-1; Fri, 20 Jan 2023 03:55:04 -0500 Received: from dggpeml500022.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NytZ14GVDzZfp5 for ; Fri, 20 Jan 2023 16:53:13 +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; Fri, 20 Jan 2023 16:55:00 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674204913; 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=Jbj596iCNoVtI3FvCwhSY+ucp2lkQKumFUKk8FhYtbQ=; b=RWlLrWBl9IHZRk7b8+KM1W47d1XLzx0vNQD7Ikzq+IgO2m8U2CbYlrnvdaIljnP+wPdA5O 9Z0SEln6p2SpwViH6CIp86z5kM2hu6eWvlU24ew3kUpZ2X00K70mfgSbgQbgGxsTmhyjDI J5pKoXZIuc+nAxosVKWtDcwckJJkcok= X-MC-Unique: rhQdDB0POf2MqFq3bPYHsA-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: UTvBLqVpN-KOjdMIRlco9A-1 From: Jiang Jiacheng To: Subject: [PATCH 3/4] qemu: support set parallel migration compression method Date: Fri, 20 Jan 2023 16:47:42 +0800 Message-ID: <20230120084743.825806-4-jiangjiacheng@huawei.com> In-Reply-To: <20230120084743.825806-1-jiangjiacheng@huawei.com> References: <20230120084743.825806-1-jiangjiacheng@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) 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.9 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.1 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: 1674204917082100001 Content-Type: text/plain; charset="utf-8" Add 'qemuMigrationParamsSetParallelCompression' to support set parallel migration compression method. Depending on whether '--parallel' is set, we invoke different functions to select compression method from the same param 'VIR_MIGRATE_PARAM_COMPRESSION'. Signed-off-by: Jiang Jiacheng --- src/qemu/qemu_migration_params.c | 76 +++++++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_par= ams.c index 380fc7dccd..4980761712 100644 --- a/src/qemu/qemu_migration_params.c +++ b/src/qemu/qemu_migration_params.c @@ -71,6 +71,8 @@ struct _qemuMigrationParams { typedef enum { QEMU_MIGRATION_COMPRESS_XBZRLE =3D 0, QEMU_MIGRATION_COMPRESS_MT, + QEMU_MIGRATION_COMPRESS_ZLIB, + QEMU_MIGRATION_COMPRESS_ZSTD, =20 QEMU_MIGRATION_COMPRESS_LAST } qemuMigrationCompressMethod; @@ -79,6 +81,8 @@ VIR_ENUM_IMPL(qemuMigrationCompressMethod, QEMU_MIGRATION_COMPRESS_LAST, "xbzrle", "mt", + "zlib", + "zstd", ); =20 VIR_ENUM_IMPL(qemuMigrationCapability, @@ -524,6 +528,60 @@ qemuMigrationParamsSetTPString(qemuMigrationParams *mi= gParams, migParams->params[param].value.s); } =20 +static int +qemuMigrationParamsSetParallelCompression(virTypedParameterPtr params, + int nparams, + qemuMigrationParams *migParams) +{ + size_t i; + int method; + const char *value =3D NULL; + int rc; + + for (i =3D 0; i < nparams; i++) { + if (STRNEQ(params[i].field, VIR_MIGRATE_PARAM_COMPRESSION)) + continue; + if (migParams->params[QEMU_MIGRATION_PARAM_MULTIFD_COMPRESSION].se= t) { + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("Only one compression method could be specifi= ed with " + "multifd compression")); + return -1; + } + + method =3D qemuMigrationCompressMethodTypeFromString(params[i].val= ue.s); + if (method < 2) { + virReportError(VIR_ERR_INVALID_ARG, + _("Unsupported compression method '%s' with mul= tifd migration"), + params[i].value.s); + return -1; + } + + migParams->compMethods |=3D 1ULL << method; + + if ((rc =3D virTypedParamsGetString(params, nparams, + VIR_MIGRATE_PARAM_COMPRESSION, &= value)) < 0) + return -1; + + migParams->params[QEMU_MIGRATION_PARAM_MULTIFD_COMPRESSION].value.= s =3D g_strdup(value); + migParams->params[QEMU_MIGRATION_PARAM_MULTIFD_COMPRESSION].set = =3D !!rc; + } + + if (migParams->params[QEMU_MIGRATION_PARAM_MULTIFD_ZLIB_LEVEL].set && + !(migParams->compMethods & (1ULL << QEMU_MIGRATION_COMPRESS_ZLIB))= ) { + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("Turn zlib compression on to tune it")); + return -1; + } + + if (migParams->params[QEMU_MIGRATION_PARAM_MULTIFD_ZSTD_LEVEL].set && + !(migParams->compMethods & (1ULL << QEMU_MIGRATION_COMPRESS_ZSTD))= ) { + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("Turn zstd compression on to tune it")); + return -1; + } + + return 0; +} =20 =20 static int @@ -548,6 +606,13 @@ qemuMigrationParamsSetCompression(virTypedParameterPtr= params, return -1; } =20 + if (method > 1) { + virReportError(VIR_ERR_INVALID_ARG, + _("Trun parallel migration on to use compressio= n method '%s'"), + params[i].value.s); + return -1; + } + if (migParams->compMethods & (1ULL << method)) { virReportError(VIR_ERR_INVALID_ARG, _("Compression method '%s' is specified twice"), @@ -566,6 +631,8 @@ qemuMigrationParamsSetCompression(virTypedParameterPtr = params, cap =3D QEMU_MIGRATION_CAP_COMPRESS; break; =20 + case QEMU_MIGRATION_COMPRESS_ZLIB: + case QEMU_MIGRATION_COMPRESS_ZSTD: case QEMU_MIGRATION_COMPRESS_LAST: default: continue; @@ -691,8 +758,13 @@ qemuMigrationParamsFromFlags(virTypedParameterPtr para= ms, return NULL; } =20 - if (qemuMigrationParamsSetCompression(params, nparams, flags, migParam= s) < 0) - return NULL; + if (flags & VIR_MIGRATE_PARALLEL) { + if (qemuMigrationParamsSetParallelCompression(params, nparams, mig= Params) < 0) + return NULL; + } else { + if (qemuMigrationParamsSetCompression(params, nparams, flags, migP= arams) < 0) + return NULL; + } =20 return g_steal_pointer(&migParams); } --=20 2.33.0 From nobody Sat May 18 23:55:34 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=1674204964; cv=none; d=zohomail.com; s=zohoarc; b=FqwmMiEIywr+vXdE5JhSY5X4oNGxJllApKjTTZ74YSVf7VF8ZD/ubF+mfJhqIY3zESEbR+4wey7oQV2O/yw6Pw8QX8lyGNZaruStyE7S03k5En8VPE6sfwLM0X7lIAuqHMjeKK0Ct6oZo/kN5R9eJ7b1/aIgBO13IEGycjmSvO0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674204964; 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=rhDwejHn0bVtnLL87TbHMFR3T7xKhdAdNJkmU9bAZN0=; b=KbkI+lWYmaRzE2IMIl6WbYKLWOHL6zCUqrjpnzItuXKOMJCTDlE+1ffPWjm1Bv0F5O2TN+AmZ4OwA6cn1m2ufbXtOrX0fibtL0EWiJ3XTXMbtV2OoJPYJqnazcQ9enaSgYRmMmOTpyJGhIGtZODM8Ao0VSPJ0Aqm1lHaTz/N6p0= 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 1674204964220266.3912494210957; Fri, 20 Jan 2023 00:56:04 -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-618-vDTL1qcFMwysmWg5B-eePw-1; Fri, 20 Jan 2023 03:55:15 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 880C5858F09; Fri, 20 Jan 2023 08:55:13 +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 74F53492B02; Fri, 20 Jan 2023 08:55:13 +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 4F0C91946A76; Fri, 20 Jan 2023 08:55:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6C8091946A6D for ; Fri, 20 Jan 2023 08:55:11 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 5F59C40444C5; Fri, 20 Jan 2023 08:55:11 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast09.extmail.prod.ext.rdu2.redhat.com [10.11.55.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 589B140C2064 for ; Fri, 20 Jan 2023 08:55:11 +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 396AF2932493 for ; Fri, 20 Jan 2023 08:55:11 +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-615-5zhO_BQjOWGjCVm7K8I1XA-1; Fri, 20 Jan 2023 03:55:08 -0500 Received: from dggpeml500022.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NytZR4qJ1zJrYk for ; Fri, 20 Jan 2023 16:53:35 +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; Fri, 20 Jan 2023 16:55:00 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674204963; 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=rhDwejHn0bVtnLL87TbHMFR3T7xKhdAdNJkmU9bAZN0=; b=Iqn4I4EdSAFYW9TESz1cO5w0sNm2Wfn49OzjbxUaTH7yP0AN0kx4IZpBYaqJOocn4Kof2g FneT+k1cZ1F6YLbNBxZAE6YRYzLJ6JLgU2vokXBk1VyParNvf192ZPb+m2OOYgldEy86Q9 2xId90eP1yy3lCdQaVPb7cnaGuxVuOs= X-MC-Unique: vDTL1qcFMwysmWg5B-eePw-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: 5zhO_BQjOWGjCVm7K8I1XA-1 From: Jiang Jiacheng To: Subject: [PATCH 4/4] virsh: Add migrate options to set parallel compress level Date: Fri, 20 Jan 2023 16:47:43 +0800 Message-ID: <20230120084743.825806-5-jiangjiacheng@huawei.com> In-Reply-To: <20230120084743.825806-1-jiangjiacheng@huawei.com> References: <20230120084743.825806-1-jiangjiacheng@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) 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.1 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.10 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: 1674204965004100002 Content-Type: text/plain; charset="utf-8" Add migrate options: --compression-zlib-level --compression-zstd-level These options are used to set compress level for "zlib" or "zstd" during parallel migration if the compress method is specified. Signed-off-by: Jiang Jiacheng --- docs/manpages/virsh.rst | 22 +++++++++++++++------- tools/virsh-domain.c | 26 ++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index d5b614dc03..a837e3c1af 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] + [--comp-zlib-level][--comp-zstd-level]] [--bandwidth bandwidth] [--tls-destination hostname] [--disks-uri URI] [--copy-storage-synchronous-writes] =20 @@ -3466,11 +3467,14 @@ option for this to work. with *--comp-methods*. Supported methods are "mt" and "xbzrle" and can be used in any combination. When no methods are specified, a hypervisor default methods will be used. QEMU defaults to "xbzrle". Compression metho= ds -can be tuned further. *--comp-mt-level* sets compression level. -Values are in range from 0 to 9, where 1 is maximum speed and 9 is maximum -compression. *--comp-mt-threads* and *--comp-mt-dthreads* set the number -of compress threads on source and the number of decompress threads on targ= et -respectively. *--comp-xbzrle-cache* sets size of page cache in bytes. +can be tuned further. When used with --parallel, supported methods are "zl= ib" +and "zstd" and if no methods are specified, QEMU will deaults to "none". +Note that compression method is defferent from compress migration and mult= ifd +migration. *--comp-mt-level* sets compression level. Values are in range f= rom +0 to 9, where 1 is maximum speed and 9 is maximum compression. +*--comp-mt-threads* and *--comp-mt-dthreads* set the number of compress th= reads +on source and the number of decompress threads on target respectively. +*--comp-xbzrle-cache* sets size of page cache in bytes. =20 Providing *--tls* causes the migration to use the host configured TLS setup (see migrate_tls_x509_cert_dir in /etc/libvirt/qemu.conf) in order to perf= orm @@ -3486,7 +3490,11 @@ 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. *--comp-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. *--comp-zstd-level* sets the compression level when +using "zstd" as multifd migration's compression mesthod. Values are in ran= ge +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..bcf03e9567 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -11095,6 +11095,14 @@ static const vshCmdOptDef opts_migrate[] =3D { .type =3D VSH_OT_INT, .help =3D N_("number of connections for parallel migration") }, + {.name =3D "comp-zlib-level", + .type =3D VSH_OT_INT, + .help =3D N_("zlib compression level used in parallel migration") + }, + {.name =3D "comp-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 +11334,24 @@ doMigrate(void *opaque) goto save_error; } =20 + if ((rv =3D vshCommandOptInt(ctl, cmd, "comp-zlib-level", &intOpt)) < = 0) { + goto out; + } else if (rv > 0) { + if (virTypedParamsAddInt(¶ms, &nparams, &maxparams, + VIR_MIGRATE_PARAM_COMPRESSION_ZLIB_LEVEL, + intOpt) < 0) + goto save_error; + } + + if ((rv =3D vshCommandOptInt(ctl, cmd, "comp-zstd-level", &intOpt)) < = 0) { + goto out; + } else if (rv > 0) { + if (virTypedParamsAddInt(¶ms, &nparams, &maxparams, + VIR_MIGRATE_PARAM_COMPRESSION_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