virsh: Add migrate options to set parallel compress level

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>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
Jiang Jiacheng
2023-02-24 17:27:11 +08:00
committed by Jiri Denemark
parent 150ae3e62b
commit 4ab5591c95
2 changed files with 47 additions and 9 deletions

View File

@@ -11076,6 +11076,14 @@ static const vshCmdOptDef opts_migrate[] = {
.completer = virshCompleteEmpty,
.help = N_("override the destination host name used for TLS verification")
},
{.name = "comp-zlib-level",
.type = VSH_OT_INT,
.help = N_("compress level for zlib compression")
},
{.name = "comp-zstd-level",
.type = VSH_OT_INT,
.help = N_("compress level for zstd compression")
},
{.name = NULL}
};
@@ -11288,6 +11296,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) {