On Tue, Jan 21, 2025 at 06:40:32PM +0530, Prasad Pandit wrote:
> From: Prasad Pandit <p...@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 <p...@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
> 

This is only one test out of many I listed in the previous email:

https://lore.kernel.org/qemu-devel/ZykJBq7ME5jgSzCA@x1n/

Would you please add all the tests mentioned there?

Thanks,

-- 
Peter Xu


Reply via email to