diff options
author | Peter Xu <peterx@redhat.com> | 2023-02-01 16:10:54 -0500 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2023-02-06 19:22:56 +0100 |
commit | d5890ea0722831eea76a0efd23a496b3e8815fe8 (patch) | |
tree | c9d365c7db03036f2928100155bb8d77ccad6bee /tests/qtest/migration-test.c | |
parent | d9df92925ef2b7ca8774ef44b0e1f859a91d4cd6 (diff) |
util/userfaultfd: Add uffd_open()
Add a helper to create the uffd handle.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'tests/qtest/migration-test.c')
-rw-r--r-- | tests/qtest/migration-test.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 1dd32c9506..109bc8e7b1 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -61,14 +61,14 @@ static bool uffd_feature_thread_id; #if defined(__linux__) && defined(__NR_userfaultfd) && defined(CONFIG_EVENTFD) #include <sys/eventfd.h> #include <sys/ioctl.h> -#include <linux/userfaultfd.h> +#include "qemu/userfaultfd.h" static bool ufd_version_check(void) { struct uffdio_api api_struct; uint64_t ioctl_mask; - int ufd = syscall(__NR_userfaultfd, O_CLOEXEC); + int ufd = uffd_open(O_CLOEXEC); if (ufd == -1) { g_test_message("Skipping test: userfaultfd not available"); |