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 <[email protected]> Signed-off-by: Michael Roth <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Peter Xu <[email protected]> --- tests/qtest/migration/precopy-tests.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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); -- 2.55.0
