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=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