diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2018-03-28 14:18:04 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2018-04-09 12:57:06 +0200 |
commit | 648abbfbaa4462bc015b15dd335068638bee4246 (patch) | |
tree | edd66fa38ebf98d2e7b0b3c7287511eccefdf5cb /include/qemu | |
parent | 053e45d2f3d3eb51799f371a39434699984e9019 (diff) | |
download | qemu-648abbfbaa4462bc015b15dd335068638bee4246.zip qemu-648abbfbaa4462bc015b15dd335068638bee4246.tar.gz qemu-648abbfbaa4462bc015b15dd335068638bee4246.tar.bz2 |
memfd: fix vhost-user-test on non-memfd capable host
On RHEL7, memfd is not supported, and vhost-user-test fails:
TEST: tests/vhost-user-test... (pid=10248)
/x86_64/vhost-user/migrate:
qemu-system-x86_64: -object memory-backend-memfd,id=mem,size=2M,: failed to create memfd
FAIL
There is a qemu_memfd_check() to prevent running memfd path, but it
also checks for fallback implementation. Let's specialize
qemu_memfd_check() to check memfd only, while qemu_memfd_alloc_check()
checks for the qemu_memfd_alloc() API.
Reported-by: Miroslav Rezanina <mrezanin@redhat.com>
Tested-by: Miroslav Rezanina <mrezanin@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20180328121804.16203-1-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Diffstat (limited to 'include/qemu')
-rw-r--r-- | include/qemu/memfd.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/qemu/memfd.h b/include/qemu/memfd.h index de10198..49e7963 100644 --- a/include/qemu/memfd.h +++ b/include/qemu/memfd.h @@ -18,6 +18,7 @@ int qemu_memfd_create(const char *name, size_t size, bool hugetlb, uint64_t hugetlbsize, unsigned int seals, Error **errp); +bool qemu_memfd_alloc_check(void); void *qemu_memfd_alloc(const char *name, size_t size, unsigned int seals, int *fd, Error **errp); void qemu_memfd_free(void *ptr, size_t size, int fd); |