diff mbox series

[2/7] tests/qtest/migration: Make 'has_dirty_ring' generic

Message ID 20250128135429.8500-3-philmd@linaro.org
State New
Headers show
Series tests/qtest/migration: Update framework to allow using HVF accelerator | expand

Commit Message

Philippe Mathieu-Daudé Jan. 28, 2025, 1:54 p.m. UTC
Keep accelerator knowledge limited within MigrationTestEnv,
expose a generic %has_dirty_ring value, only checking for
KVM when initializing it in migration_get_env().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 tests/qtest/migration/framework.c     | 2 +-
 tests/qtest/migration/precopy-tests.c | 6 ++----
 2 files changed, 3 insertions(+), 5 deletions(-)

Comments

Fabiano Rosas Jan. 28, 2025, 2:29 p.m. UTC | #1
Philippe Mathieu-Daudé <philmd@linaro.org> writes:

> Keep accelerator knowledge limited within MigrationTestEnv,
> expose a generic %has_dirty_ring value, only checking for
> KVM when initializing it in migration_get_env().
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Reviewed-by: Fabiano Rosas <farosas@suse.de>
diff mbox series

Patch

diff --git a/tests/qtest/migration/framework.c b/tests/qtest/migration/framework.c
index 4550cda129c..a3bd92a9519 100644
--- a/tests/qtest/migration/framework.c
+++ b/tests/qtest/migration/framework.c
@@ -946,7 +946,7 @@  MigrationTestEnv *migration_get_env(void)
         return env;
     }
 
-    env->has_dirty_ring = kvm_dirty_ring_supported();
+    env->has_dirty_ring = env->has_kvm && kvm_dirty_ring_supported();
     env->has_uffd = ufd_version_check(&env->uffd_feature_thread_id);
     env->arch = qtest_get_arch();
     env->is_x86 = !strcmp(env->arch, "i386") || !strcmp(env->arch, "x86_64");
diff --git a/tests/qtest/migration/precopy-tests.c b/tests/qtest/migration/precopy-tests.c
index 23599b29ee2..8dcd0ad2660 100644
--- a/tests/qtest/migration/precopy-tests.c
+++ b/tests/qtest/migration/precopy-tests.c
@@ -983,8 +983,7 @@  void migration_test_add_precopy(MigrationTestEnv *env)
     if (g_test_slow()) {
         migration_test_add("/migration/auto_converge",
                            test_auto_converge);
-        if (g_str_equal(env->arch, "x86_64") &&
-            env->has_kvm && env->has_dirty_ring) {
+        if (g_str_equal(env->arch, "x86_64") && env->has_dirty_ring) {
             migration_test_add("/dirty_limit",
                                test_dirty_limit);
         }
@@ -999,8 +998,7 @@  void migration_test_add_precopy(MigrationTestEnv *env)
                        test_multifd_tcp_no_zero_page);
     migration_test_add("/migration/multifd/tcp/plain/cancel",
                        test_multifd_tcp_cancel);
-    if (g_str_equal(env->arch, "x86_64")
-        && env->has_kvm && env->has_dirty_ring) {
+    if (g_str_equal(env->arch, "x86_64") && env->has_dirty_ring) {
 
         migration_test_add("/migration/dirty_ring",
                            test_precopy_unix_dirty_ring);