qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Prasad Pandit <ppandit@redhat.com>
To: qemu-devel@nongnu.org
Cc: peterx@redhat.com, farosas@suse.de, berrange@redhat.com,
	Prasad Pandit <pjp@fedoraproject.org>
Subject: [PATCH v3 4/4] tests/qtest/migration: add postcopy test with multifd
Date: Tue, 21 Jan 2025 18:40:32 +0530	[thread overview]
Message-ID: <20250121131032.1611245-5-ppandit@redhat.com> (raw)
In-Reply-To: <20250121131032.1611245-1-ppandit@redhat.com>

From: Prasad Pandit <pjp@fedoraproject.org>

Add a new postcopy test 'migration/postcopy/multifd'
to run postcopy migration with multifd channels enabled.
Add a boolean field 'multifd' to the MigrateCommon struct.
It helps to enable multifd channels.

Signed-off-by: Prasad Pandit <pjp@fedoraproject.org>
---
 tests/qtest/migration/framework.c      |  8 ++++++++
 tests/qtest/migration/framework.h      |  3 +++
 tests/qtest/migration/postcopy-tests.c | 10 ++++++++++
 3 files changed, 21 insertions(+)

diff --git a/tests/qtest/migration/framework.c b/tests/qtest/migration/framework.c
index 4550cda129..7f5abd760e 100644
--- a/tests/qtest/migration/framework.c
+++ b/tests/qtest/migration/framework.c
@@ -427,6 +427,14 @@ static int migrate_postcopy_prepare(QTestState **from_ptr,
         migrate_set_capability(to, "postcopy-preempt", true);
     }
 
+    if (args->multifd) {
+        migrate_set_capability(from, "multifd", true);
+        migrate_set_capability(to, "multifd", true);
+
+        migrate_set_parameter_int(from, "multifd-channels", 8);
+        migrate_set_parameter_int(to, "multifd-channels", 8);
+    }
+
     migrate_ensure_non_converge(from);
 
     migrate_prepare_for_dirty_mem(from);
diff --git a/tests/qtest/migration/framework.h b/tests/qtest/migration/framework.h
index 7991ee56b6..1b2320ebef 100644
--- a/tests/qtest/migration/framework.h
+++ b/tests/qtest/migration/framework.h
@@ -193,6 +193,9 @@ typedef struct {
      */
     bool live;
 
+    /* set multifd on */
+    bool multifd;
+
     /* Postcopy specific fields */
     void *postcopy_data;
     bool postcopy_preempt;
diff --git a/tests/qtest/migration/postcopy-tests.c b/tests/qtest/migration/postcopy-tests.c
index daf7449f2c..6eada6ccbc 100644
--- a/tests/qtest/migration/postcopy-tests.c
+++ b/tests/qtest/migration/postcopy-tests.c
@@ -27,6 +27,15 @@ static void test_postcopy(void)
     test_postcopy_common(&args);
 }
 
+static void test_postcopy_multifd(void)
+{
+    MigrateCommon args = {
+        .multifd = true,
+    };
+
+    test_postcopy_common(&args);
+}
+
 static void test_postcopy_suspend(void)
 {
     MigrateCommon args = {
@@ -83,6 +92,7 @@ void migration_test_add_postcopy(MigrationTestEnv *env)
 {
     if (env->has_uffd) {
         migration_test_add("/migration/postcopy/plain", test_postcopy);
+        migration_test_add("/migration/postcopy/multifd", test_postcopy_multifd);
         migration_test_add("/migration/postcopy/recovery/plain",
                            test_postcopy_recovery);
         migration_test_add("/migration/postcopy/preempt/plain",
--
2.48.1



  parent reply	other threads:[~2025-01-21 13:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-21 13:10 [PATCH v3 0/4] Allow to enable multifd and postcopy migration together Prasad Pandit
2025-01-21 13:10 ` [PATCH v3 1/4] migration/multifd: move macros to multifd header Prasad Pandit
2025-01-21 13:10 ` [PATCH v3 2/4] migration: refactor ram_save_target_page functions Prasad Pandit
2025-01-21 13:10 ` [PATCH v3 3/4] migration: enable multifd and postcopy together Prasad Pandit
2025-01-21 13:10 ` Prasad Pandit [this message]
2025-01-21 15:47   ` [PATCH v3 4/4] tests/qtest/migration: add postcopy test with multifd Peter Xu
2025-01-22  7:56     ` Prasad Pandit
2025-01-22 16:10       ` Peter Xu
2025-01-23 11:09         ` Prasad Pandit
2025-01-24 12:45           ` Prasad Pandit
2025-01-24 15:38             ` Peter Xu
2025-01-25 12:15               ` Prasad Pandit
2025-01-21 15:50 ` [PATCH v3 0/4] Allow to enable multifd and postcopy migration together Peter Xu

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=20250121131032.1611245-5-ppandit@redhat.com \
    --to=ppandit@redhat.com \
    --cc=berrange@redhat.com \
    --cc=farosas@suse.de \
    --cc=peterx@redhat.com \
    --cc=pjp@fedoraproject.org \
    --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).