[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 4/4] tests/qtest/migration: add postcopy test with multifd
From: |
Prasad Pandit |
Subject: |
[PATCH v3 4/4] tests/qtest/migration: add postcopy test with multifd |
Date: |
Tue, 21 Jan 2025 18:40:32 +0530 |
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
- [PATCH v3 0/4] Allow to enable multifd and postcopy migration together, Prasad Pandit, 2025/01/21
- [PATCH v3 1/4] migration/multifd: move macros to multifd header, Prasad Pandit, 2025/01/21
- [PATCH v3 2/4] migration: refactor ram_save_target_page functions, Prasad Pandit, 2025/01/21
- [PATCH v3 4/4] tests/qtest/migration: add postcopy test with multifd,
Prasad Pandit <=
- Re: [PATCH v3 4/4] tests/qtest/migration: add postcopy test with multifd, Peter Xu, 2025/01/21
- Re: [PATCH v3 4/4] tests/qtest/migration: add postcopy test with multifd, Prasad Pandit, 2025/01/22
- Re: [PATCH v3 4/4] tests/qtest/migration: add postcopy test with multifd, Peter Xu, 2025/01/22
- Re: [PATCH v3 4/4] tests/qtest/migration: add postcopy test with multifd, Prasad Pandit, 2025/01/23
- Re: [PATCH v3 4/4] tests/qtest/migration: add postcopy test with multifd, Prasad Pandit, 2025/01/24
- Re: [PATCH v3 4/4] tests/qtest/migration: add postcopy test with multifd, Peter Xu, 2025/01/24
- Re: [PATCH v3 4/4] tests/qtest/migration: add postcopy test with multifd, Prasad Pandit, 2025/01/25
[PATCH v3 3/4] migration: enable multifd and postcopy together, Prasad Pandit, 2025/01/21
Re: [PATCH v3 0/4] Allow to enable multifd and postcopy migration together, Peter Xu, 2025/01/21