@@ -1312,6 +1312,12 @@ static void migrate_params_test_apply(MigrateSetParameters *params,
if (params->has_multifd_compression) {
dest->multifd_compression = params->multifd_compression;
}
+ if (params->has_multifd_zlib_level) {
+ dest->multifd_zlib_level = params->multifd_zlib_level;
+ }
+ if (params->has_multifd_zstd_level) {
+ dest->multifd_zstd_level = params->multifd_zstd_level;
+ }
if (params->has_xbzrle_cache_size) {
dest->xbzrle_cache_size = params->xbzrle_cache_size;
}
@@ -1447,6 +1453,12 @@ static void migrate_params_apply(MigrateSetParameters *params, Error **errp)
if (params->has_multifd_compression) {
s->parameters.multifd_compression = params->multifd_compression;
}
+ if (params->has_multifd_zlib_level) {
+ s->parameters.multifd_zlib_level = params->multifd_zlib_level;
+ }
+ if (params->has_multifd_zstd_level) {
+ s->parameters.multifd_zstd_level = params->multifd_zstd_level;
+ }
if (params->has_xbzrle_cache_size) {
s->parameters.xbzrle_cache_size = params->xbzrle_cache_size;
xbzrle_cache_resize(params->xbzrle_cache_size, errp);
@@ -2621,10 +2621,24 @@ test_migrate_precopy_tcp_multifd_start(QTestState *from,
return test_migrate_precopy_tcp_multifd_start_common(from, to, "none");
}
+static void
+test_and_set_multifd_compression_level(QTestState *who, const char *param)
+{
+ /* The default compression level is 1, test a level other than 1 */
+ int level = 2;
+
+ migrate_set_parameter_int(who, param, level);
+ migrate_check_parameter_int(who, param, level);
+ /* only test compression level 1 during migration */
+ migrate_set_parameter_int(who, param, 1);
+}
+
static void *
test_migrate_precopy_tcp_multifd_zlib_start(QTestState *from,
QTestState *to)
{
+ /* the compression level is used only on the source side. */
+ test_and_set_multifd_compression_level(from, "multifd-zlib-level");
return test_migrate_precopy_tcp_multifd_start_common(from, to, "zlib");
}
@@ -2633,6 +2647,8 @@ static void *
test_migrate_precopy_tcp_multifd_zstd_start(QTestState *from,
QTestState *to)
{
+ /* the compression level is used only on the source side. */
+ test_and_set_multifd_compression_level(from, "multifd-zstd-level");
return test_migrate_precopy_tcp_multifd_start_common(from, to, "zstd");
}
#endif /* CONFIG_ZSTD */