Skip to contentSkip to conversation

*** Properly apply migration compression level

PATCH Applied Bryan Zhang 2 participants 4 messages Mar 1, 2024

lore
Share & tools
lore
#0 lore raw

cover *** Properly apply migration compression level

From: Bryan Zhang <[email protected]>

There is some glue code missing, such that the qmp_migrate_set_parameters function does not properly update the multifd_zstd_level and multifd_zlib_level parameters. This patch adds the glue code and also adds some function calls to the existing migration tests to make sure the set_parameters function gets tested.

Bryan Zhang (2):
migration: Properly apply migration compression level parameters tests/migration: Set compression level in migration tests

 migration/options.c          | 12 ++++++++++++
 tests/qtest/migration-test.c | 10 ++++++++++
 2 files changed, 22 insertions(+)
Signature · 1 line
2.30.2
#1 lore raw

PATCH 1/2 migration: Properly apply migration compression level parameters

From: Bryan Zhang <[email protected]>

Some glue code was missing, so that using qmp_migrate_set_parameters to set multifd-zstd-level or multifd-zlib-level did not work. This commit adds the glue code to fix that.

---
 migration/options.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
migration/options.c +12 -0
index 3e3e0b93b4..1cd3cc7c33 100644
@@ -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);
Signature · 1 line
2.30.2
#2 lore raw

PATCH 2/2 tests/migration: Set compression level in migration tests

In reply to Bryan Zhang

From: Bryan Zhang <[email protected]>

Adds calls to set compression level for zstd and zlib migration tests, just to make sure that the calls work.

---
 tests/qtest/migration-test.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
tests/qtest/migration-test.c +10 -0
index 8a5bb1752e..f23e860547 100644
@@ -2625,6 +2625,13 @@ static void *
 test_migrate_precopy_tcp_multifd_zlib_start(QTestState *from,
                                             QTestState *to)
 {
+    /*
+     * Overloading this test to also check that set_parameter does not error.
+     * This is also done in the tests for the other compression methods.
+     */
+    migrate_set_parameter_int(from, "multifd-zlib-level", 2);
+    migrate_set_parameter_int(to, "multifd-zlib-level", 2);
+
     return test_migrate_precopy_tcp_multifd_start_common(from, to, "zlib");
 }
 
@@ -2633,6 +2640,9 @@ static void *
 test_migrate_precopy_tcp_multifd_zstd_start(QTestState *from,
                                             QTestState *to)
 {
+    migrate_set_parameter_int(from, "multifd-zstd-level", 2);
+    migrate_set_parameter_int(to, "multifd-zstd-level", 2);
+
     return test_migrate_precopy_tcp_multifd_start_common(from, to, "zstd");
 }
 #endif /* CONFIG_ZSTD */
Signature · 1 line
2.30.2
Applied
#3 lore raw
In reply to Bryan Zhang
Quoted 11 lines · Bryan Zhang

From: Bryan Zhang <[email protected]>

There is some glue code missing, such that the qmp_migrate_set_parameters function does not properly update the multifd_zstd_level and multifd_zlib_level parameters. This patch adds the glue code and also adds some function calls to the existing migration tests to make sure the set_parameters function gets tested.

Bryan Zhang (2):
migration: Properly apply migration compression level parameters tests/migration: Set compression level in migration tests

queued, thanks!

Signature · 1 line
Peter Xu