qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Yuan Liu <yuan1.liu@intel.com>
To: peterx@redhat.com, farosas@suse.de
Cc: qemu-devel@nongnu.org, hao.xiang@bytedance.com,
	bryan.zhang@bytedance.com, yuan1.liu@intel.com,
	nanhai.zou@intel.com
Subject: [PATCH v4 7/8] migration/multifd: fix zlib and zstd compression levels not working
Date: Mon,  4 Mar 2024 22:00:27 +0800	[thread overview]
Message-ID: <20240304140028.1590649-8-yuan1.liu@intel.com> (raw)
In-Reply-To: <20240304140028.1590649-1-yuan1.liu@intel.com>

add zlib and zstd compression levels in multifd parameter
testing and application and add compression level tests

Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Reviewed-by: Nanhai Zou <nanhai.zou@intel.com>
Reported-by: Xiaohui Li <xiaohli@redhat.com>
---
 migration/options.c          | 12 ++++++++++++
 tests/qtest/migration-test.c | 16 ++++++++++++++++
 2 files changed, 28 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);
diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index 8a5bb1752e..23d50fe599 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -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 */
-- 
2.39.3



  parent reply	other threads:[~2024-03-05  5:49 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-04 14:00 [PATCH v4 0/8] Live Migration With IAA Yuan Liu
2024-03-04 14:00 ` [PATCH v4 1/8] docs/migration: add qpl compression feature Yuan Liu
2024-03-04 14:00 ` [PATCH v4 2/8] migration/multifd: add get_iov_count in the multifd method Yuan Liu
2024-03-05 20:24   ` Fabiano Rosas
2024-03-06  1:16     ` Liu, Yuan1
2024-03-04 14:00 ` [PATCH v4 3/8] configure: add --enable-qpl build option Yuan Liu
2024-03-05 20:32   ` Fabiano Rosas
2024-03-06  2:20     ` Liu, Yuan1
2024-03-06 11:56       ` Fabiano Rosas
2024-03-07  6:45         ` Liu, Yuan1
2024-03-04 14:00 ` [PATCH v4 4/8] migration/multifd: add qpl compression method Yuan Liu
2024-03-05 20:58   ` Fabiano Rosas
2024-03-06  2:29     ` Liu, Yuan1
2024-03-04 14:00 ` [PATCH v4 5/8] migration/multifd: implement initialization of qpl compression Yuan Liu
2024-03-04 14:00 ` [PATCH v4 6/8] migration/multifd: implement qpl compression and decompression Yuan Liu
2024-03-04 14:00 ` Yuan Liu [this message]
2024-03-04 14:00 ` [PATCH v4 8/8] tests/migration-test: add qpl compression test Yuan Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240304140028.1590649-8-yuan1.liu@intel.com \
    --to=yuan1.liu@intel.com \
    --cc=bryan.zhang@bytedance.com \
    --cc=farosas@suse.de \
    --cc=hao.xiang@bytedance.com \
    --cc=nanhai.zou@intel.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).