[PATCH 4/4] virsh: Add migrate options to set parallel compress level

Jiang Jiacheng posted 4 patches 3 years ago
There is a newer version of this series
[PATCH 4/4] virsh: Add migrate options to set parallel compress level
Posted by Jiang Jiacheng 3 years ago
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@huawei.com>
---
 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]
 
@@ -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.
 
 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")
+    },
     {.name = "bandwidth",
      .type = VSH_OT_INT,
      .help = N_("migration bandwidth limit in MiB/s")
@@ -11326,6 +11334,24 @@ doMigrate(void *opaque)
             goto save_error;
     }
 
+    if ((rv = vshCommandOptInt(ctl, cmd, "comp-zlib-level", &intOpt)) < 0) {
+        goto out;
+    } else if (rv > 0) {
+        if (virTypedParamsAddInt(&params, &nparams, &maxparams,
+                                 VIR_MIGRATE_PARAM_COMPRESSION_ZLIB_LEVEL,
+                                 intOpt) < 0)
+            goto save_error;
+    }
+
+    if ((rv = vshCommandOptInt(ctl, cmd, "comp-zstd-level", &intOpt)) < 0) {
+        goto out;
+    } else if (rv > 0) {
+        if (virTypedParamsAddInt(&params, &nparams, &maxparams,
+                                 VIR_MIGRATE_PARAM_COMPRESSION_ZSTD_LEVEL,
+                                 intOpt) < 0)
+            goto save_error;
+    }
+
     if ((rv = vshCommandOptULongLong(ctl, cmd, "bandwidth", &ullOpt)) < 0) {
         goto out;
     } else if (rv > 0) {
-- 
2.33.0
Re: [PATCH 4/4] virsh: Add migrate options to set parallel compress level
Posted by Jiri Denemark 3 years ago
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@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
Re: [PATCH 4/4] virsh: Add migrate options to set parallel compress level
Posted by Claudio Fontana 3 years ago
On 1/20/23 09:47, 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@huawei.com>
> ---
>  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]

Hi, why the removal of the ] at the end of line ?

Thanks, C

> +      [--comp-zlib-level][--comp-zstd-level]]
>        [--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.
>  
>  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")
> +    },
>      {.name = "bandwidth",
>       .type = VSH_OT_INT,
>       .help = N_("migration bandwidth limit in MiB/s")
> @@ -11326,6 +11334,24 @@ doMigrate(void *opaque)
>              goto save_error;
>      }
>  
> +    if ((rv = vshCommandOptInt(ctl, cmd, "comp-zlib-level", &intOpt)) < 0) {
> +        goto out;
> +    } else if (rv > 0) {
> +        if (virTypedParamsAddInt(&params, &nparams, &maxparams,
> +                                 VIR_MIGRATE_PARAM_COMPRESSION_ZLIB_LEVEL,
> +                                 intOpt) < 0)
> +            goto save_error;
> +    }
> +
> +    if ((rv = vshCommandOptInt(ctl, cmd, "comp-zstd-level", &intOpt)) < 0) {
> +        goto out;
> +    } else if (rv > 0) {
> +        if (virTypedParamsAddInt(&params, &nparams, &maxparams,
> +                                 VIR_MIGRATE_PARAM_COMPRESSION_ZSTD_LEVEL,
> +                                 intOpt) < 0)
> +            goto save_error;
> +    }
> +
>      if ((rv = vshCommandOptULongLong(ctl, cmd, "bandwidth", &ullOpt)) < 0) {
>          goto out;
>      } else if (rv > 0) {
Re: [PATCH 4/4] virsh: Add migrate options to set parallel compress level
Posted by Jiang Jiacheng 3 years ago

On 2023/1/20 17:41, Claudio Fontana wrote:
> On 1/20/23 09:47, 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@huawei.com>
>> ---
>>  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]
> 
> Hi, why the removal of the ] at the end of line ?
> 

I move it to the back of '--comp-zstd-level', since they are options of
parallel migration and should be set only when '--parallel' is chosen.

Thanks
Jiang Jiacheng

> Thanks, C
> 
>> +      [--comp-zlib-level][--comp-zstd-level]]
>>        [--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.
>>  
>>  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")
>> +    },
>>      {.name = "bandwidth",
>>       .type = VSH_OT_INT,
>>       .help = N_("migration bandwidth limit in MiB/s")
>> @@ -11326,6 +11334,24 @@ doMigrate(void *opaque)
>>              goto save_error;
>>      }
>>  
>> +    if ((rv = vshCommandOptInt(ctl, cmd, "comp-zlib-level", &intOpt)) < 0) {
>> +        goto out;
>> +    } else if (rv > 0) {
>> +        if (virTypedParamsAddInt(&params, &nparams, &maxparams,
>> +                                 VIR_MIGRATE_PARAM_COMPRESSION_ZLIB_LEVEL,
>> +                                 intOpt) < 0)
>> +            goto save_error;
>> +    }
>> +
>> +    if ((rv = vshCommandOptInt(ctl, cmd, "comp-zstd-level", &intOpt)) < 0) {
>> +        goto out;
>> +    } else if (rv > 0) {
>> +        if (virTypedParamsAddInt(&params, &nparams, &maxparams,
>> +                                 VIR_MIGRATE_PARAM_COMPRESSION_ZSTD_LEVEL,
>> +                                 intOpt) < 0)
>> +            goto save_error;
>> +    }
>> +
>>      if ((rv = vshCommandOptULongLong(ctl, cmd, "bandwidth", &ullOpt)) < 0) {
>>          goto out;
>>      } else if (rv > 0) {
>
Re: [PATCH 4/4] virsh: Add migrate options to set parallel compress level
Posted by Claudio Fontana 3 years ago
On 1/30/23 02:59, Jiang Jiacheng wrote:
> 
> 
> On 2023/1/20 17:41, Claudio Fontana wrote:
>> On 1/20/23 09:47, 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@huawei.com>
>>> ---
>>>  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]
>>
>> Hi, why the removal of the ] at the end of line ?
>>
> 
> I move it to the back of '--comp-zstd-level', since they are options of
> parallel migration and should be set only when '--parallel' is chosen.

Got it now, sorry for the noise, thanks,

C

>>> +      [--comp-zlib-level][--comp-zstd-level]]
>>>        [--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.
>>>  
>>>  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")
>>> +    },
>>>      {.name = "bandwidth",
>>>       .type = VSH_OT_INT,
>>>       .help = N_("migration bandwidth limit in MiB/s")
>>> @@ -11326,6 +11334,24 @@ doMigrate(void *opaque)
>>>              goto save_error;
>>>      }
>>>  
>>> +    if ((rv = vshCommandOptInt(ctl, cmd, "comp-zlib-level", &intOpt)) < 0) {
>>> +        goto out;
>>> +    } else if (rv > 0) {
>>> +        if (virTypedParamsAddInt(&params, &nparams, &maxparams,
>>> +                                 VIR_MIGRATE_PARAM_COMPRESSION_ZLIB_LEVEL,
>>> +                                 intOpt) < 0)
>>> +            goto save_error;
>>> +    }
>>> +
>>> +    if ((rv = vshCommandOptInt(ctl, cmd, "comp-zstd-level", &intOpt)) < 0) {
>>> +        goto out;
>>> +    } else if (rv > 0) {
>>> +        if (virTypedParamsAddInt(&params, &nparams, &maxparams,
>>> +                                 VIR_MIGRATE_PARAM_COMPRESSION_ZSTD_LEVEL,
>>> +                                 intOpt) < 0)
>>> +            goto save_error;
>>> +    }
>>> +
>>>      if ((rv = vshCommandOptULongLong(ctl, cmd, "bandwidth", &ullOpt)) < 0) {
>>>          goto out;
>>>      } else if (rv > 0) {
>>
>