mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
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>
This commit is contained in:
parent
d9df92925e
commit
d5890ea072
4 changed files with 30 additions and 10 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue