Commit 8ada579a56 for qemu.org
commit 8ada579a562873780bfcce7795b9cd0bb0f9bca3
Author: Peter Xu <peterx@redhat.com>
Date: Tue Sep 29 18:50:18 2026 -0500
tests/migration-test: Add a precopy test for guest-memfd
Add a plain tcp test for guest-memfd. Note that the test will be
automatically skipped whenever not supported (e.g. qemu compiled without
KVM, or host kernel doesn't support kvm, or old kernels, etc.).
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Michael Roth <michael.roth@amd.com>
Link: https://lore.kernel.org/r/20260929235109.1398509-13-michael.roth@amd.com
Signed-off-by: Peter Xu <peterx@redhat.com>
diff --git a/tests/qtest/migration/precopy-tests.c b/tests/qtest/migration/precopy-tests.c
index a23d51126b..d57ffcac23 100644
--- a/tests/qtest/migration/precopy-tests.c
+++ b/tests/qtest/migration/precopy-tests.c
@@ -182,6 +182,13 @@ static void test_precopy_tcp_plain(char *name, MigrateCommon *args)
test_precopy_common(args);
}
+static void test_precopy_tcp_plain_gmemfd(char *name, MigrateCommon *args)
+{
+ args->start.mem_type = MEM_TYPE_GUEST_MEMFD;
+
+ test_precopy_common(args);
+}
+
static void test_precopy_tcp_switchover_ack(char *name, MigrateCommon *args)
{
/*
@@ -1108,6 +1115,8 @@ void migration_test_add_precopy(MigrationTestEnv *env)
return;
}
+ migration_test_add("/migration/precopy/tcp/plain/guest-memfd",
+ test_precopy_tcp_plain_gmemfd);
migration_test_add("/migration/precopy/tcp/plain/switchover-ack",
test_precopy_tcp_switchover_ack);