qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] *** Properly apply migration compression level
@ 2024-03-01  3:58 Bryan Zhang
  2024-03-01  3:59 ` [PATCH 1/2] migration: Properly apply migration compression level parameters Bryan Zhang
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Bryan Zhang @ 2024-03-01  3:58 UTC (permalink / raw)
  To: qemu-devel, peterx, farosas; +Cc: hao.xiang, Bryan Zhang

From: Bryan Zhang <bryan.zhang@BYTEDANCE.COM>

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(+)

-- 
2.30.2



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] migration: Properly apply migration compression level parameters
  2024-03-01  3:58 [PATCH 0/2] *** Properly apply migration compression level Bryan Zhang
@ 2024-03-01  3:59 ` Bryan Zhang
  2024-03-01  3:59 ` [PATCH 2/2] tests/migration: Set compression level in migration tests Bryan Zhang
  2024-03-01  4:12 ` [PATCH 0/2] *** Properly apply migration compression level Peter Xu
  2 siblings, 0 replies; 4+ messages in thread
From: Bryan Zhang @ 2024-03-01  3:59 UTC (permalink / raw)
  To: qemu-devel, peterx, farosas; +Cc: hao.xiang, Bryan Zhang, Bryan Zhang

From: Bryan Zhang <bryan.zhang@BYTEDANCE.COM>

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.

Signed-off-by: Bryan Zhang <bryan.zhang@bytedance.com>
---
 migration/options.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/migration/options.c b/migration/options.c
index 3e3e0b93b4..1cd3cc7c33 100644
--- a/migration/options.c
+++ b/migration/options.c
@@ -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);
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] tests/migration: Set compression level in migration tests
  2024-03-01  3:58 [PATCH 0/2] *** Properly apply migration compression level Bryan Zhang
  2024-03-01  3:59 ` [PATCH 1/2] migration: Properly apply migration compression level parameters Bryan Zhang
@ 2024-03-01  3:59 ` Bryan Zhang
  2024-03-01  4:12 ` [PATCH 0/2] *** Properly apply migration compression level Peter Xu
  2 siblings, 0 replies; 4+ messages in thread
From: Bryan Zhang @ 2024-03-01  3:59 UTC (permalink / raw)
  To: qemu-devel, peterx, farosas; +Cc: hao.xiang, Bryan Zhang, Bryan Zhang

From: Bryan Zhang <bryan.zhang@BYTEDANCE.COM>

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

Signed-off-by: Bryan Zhang <bryan.zhang@bytedance.com>
---
 tests/qtest/migration-test.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index 8a5bb1752e..f23e860547 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -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 */
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] *** Properly apply migration compression level
  2024-03-01  3:58 [PATCH 0/2] *** Properly apply migration compression level Bryan Zhang
  2024-03-01  3:59 ` [PATCH 1/2] migration: Properly apply migration compression level parameters Bryan Zhang
  2024-03-01  3:59 ` [PATCH 2/2] tests/migration: Set compression level in migration tests Bryan Zhang
@ 2024-03-01  4:12 ` Peter Xu
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Xu @ 2024-03-01  4:12 UTC (permalink / raw)
  To: Bryan Zhang; +Cc: qemu-devel, farosas, hao.xiang

On Fri, Mar 01, 2024 at 03:58:59AM +0000, Bryan Zhang wrote:
> From: Bryan Zhang <bryan.zhang@BYTEDANCE.COM>
> 
> 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!

-- 
Peter Xu



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-03-01  4:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-01  3:58 [PATCH 0/2] *** Properly apply migration compression level Bryan Zhang
2024-03-01  3:59 ` [PATCH 1/2] migration: Properly apply migration compression level parameters Bryan Zhang
2024-03-01  3:59 ` [PATCH 2/2] tests/migration: Set compression level in migration tests Bryan Zhang
2024-03-01  4:12 ` [PATCH 0/2] *** Properly apply migration compression level Peter Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).