summary refs log tree commit diff stats
path: root/tests/qtest/migration-test.c
diff options
context:
space:
mode:
authorFabiano Rosas <farosas@suse.de>2024-11-27 15:28:52 -0300
committerFabiano Rosas <farosas@suse.de>2024-12-12 10:25:40 -0300
commit2fa72ba79bc84bd44385af260dbacc223f7a6181 (patch)
tree051ec9a12a74300e0dc18f940ead7d43897eaac3 /tests/qtest/migration-test.c
parent124a3c58b82ad8e3662711f4deca281d81d5d56a (diff)
downloadfocaccia-qemu-2fa72ba79bc84bd44385af260dbacc223f7a6181.tar.gz
focaccia-qemu-2fa72ba79bc84bd44385af260dbacc223f7a6181.zip
tests/qtest/migration: Move kvm_dirty_ring_supported to utils
Move kvm_dirty_ring_supported() to migration-util.c. Similarly to
ufd_version_check(), this function is used during test definition so
put it in the utils file.

Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Diffstat (limited to 'tests/qtest/migration-test.c')
-rw-r--r--tests/qtest/migration-test.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index f1c1ca309a..ab7cbb8251 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -32,12 +32,6 @@
 # endif /* CONFIG_TASN1 */
 #endif /* CONFIG_GNUTLS */
 
-/* For dirty ring test; so far only x86_64 is supported */
-#if defined(__linux__) && defined(HOST_X86_64)
-#include "linux/kvm.h"
-#include <sys/ioctl.h>
-#endif
-
 unsigned start_address;
 unsigned end_address;
 static bool uffd_feature_thread_id;
@@ -3435,29 +3429,6 @@ static void test_dirty_limit(void)
     migrate_end(from, to, true);
 }
 
-static bool kvm_dirty_ring_supported(void)
-{
-#if defined(__linux__) && defined(HOST_X86_64)
-    int ret, kvm_fd = open("/dev/kvm", O_RDONLY);
-
-    if (kvm_fd < 0) {
-        return false;
-    }
-
-    ret = ioctl(kvm_fd, KVM_CHECK_EXTENSION, KVM_CAP_DIRTY_LOG_RING);
-    close(kvm_fd);
-
-    /* We test with 4096 slots */
-    if (ret < 4096) {
-        return false;
-    }
-
-    return true;
-#else
-    return false;
-#endif
-}
-
 int main(int argc, char **argv)
 {
     bool has_kvm, has_tcg;