From nobody Tue Feb 10 09:24:21 2026 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