@@ -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");
@@ -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);
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(-)