On Fri, Jan 20, 2023 at 16:47:43 +0800, Jiang Jiacheng wrote:
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 <jiangjiacheng(a)huawei.com>
---
docs/manpages/virsh.rst | 22 +++++++++++++++-------
tools/virsh-domain.c | 26 ++++++++++++++++++++++++++
2 files changed, 41 insertions(+), 7 deletions(-)
I'll have similar comments to what I said for the public API.
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]]
These should be moved two lines above after [--comp-xbzrle-cache]. And
don't forget to add a space after ']'.
[--bandwidth bandwidth] [--tls-destination hostname]
[--disks-uri URI] [--copy-storage-synchronous-writes]
@@ -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 methods
-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 target
-respectively. *--comp-xbzrle-cache* sets size of page cache in bytes.
+can be tuned further. When used with --parallel, supported methods are "zlib"
+and "zstd" and if no methods are specified, QEMU will deaults to
"none".
+Note that compression method is defferent from compress migration and multifd
+migration. *--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 target respectively.
+*--comp-xbzrle-cache* sets size of page cache in bytes.
The options for zlib and zstd compressions should be described here. I
can imagine something along the following lines:
with *--comp-methods*. Supported methods are "mt", "xbzrle",
"zlib",
and "zstd". The supported set of methods and their combinations
depend on a hypervisor and migration options. QEMU only supports
"zlib" and "zstd" methods when *--parallel* is used and they
cannot
be used at once. When no methods are specified, a hypervisor default
methods will be used. QEMU defaults to no compression for
*--parallel* migration and "xbzrle" otherwise. Compression methods
can be tuned further. *--comp-mt-level* sets compression level for
"mt" method. 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 target respectively.
*--comp-xbzrle-cache* sets size of page cache in bytes.
*--comp-zlib-level* sets the compression level when using "zlib"
method. Values are in range from 0 to 9 and defaults to 1.
*--comp-zstd-level* sets the compression level when using "zstd"
method. Values are in range from 0 to 20 and defaults to 1.
Although the semantics of the values need to be described as well. And
the same info needs to go to the first patch.
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 perform
@@ -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
range
+from 0 to 20 and defaults to 1.
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[] = {
.type = VSH_OT_INT,
.help = N_("number of connections for parallel migration")
},
+ {.name = "comp-zlib-level",
+ .type = VSH_OT_INT,
+ .help = N_("zlib compression level used in parallel migration")
+ },
+ {.name = "comp-zstd-level",
+ .type = VSH_OT_INT,
+ .help = N_("zstd compression level used in parallel migration")
+ },
Virsh options should always be added at the end, i.e., just before
{.name = NULL}
{.name = "bandwidth",
.type = VSH_OT_INT,
.help = N_("migration bandwidth limit in MiB/s")
...
Jirka