summaryrefslogtreecommitdiff
path: root/hw/virtio
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2018-03-28 14:18:04 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2018-04-09 12:57:06 +0200
commit648abbfbaa4462bc015b15dd335068638bee4246 (patch)
treeedd66fa38ebf98d2e7b0b3c7287511eccefdf5cb /hw/virtio
parent053e45d2f3d3eb51799f371a39434699984e9019 (diff)
downloadqemu-648abbfbaa4462bc015b15dd335068638bee4246.tar.gz
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 'hw/virtio')
-rw-r--r--hw/virtio/vhost.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 250f886acb..27c1ec5fe8 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -1223,7 +1223,7 @@ int vhost_dev_init(struct vhost_dev *hdev, void *opaque,
if (!(hdev->features & (0x1ULL << VHOST_F_LOG_ALL))) {
error_setg(&hdev->migration_blocker,
"Migration disabled: vhost lacks VHOST_F_LOG_ALL feature.");
- } else if (vhost_dev_log_is_shared(hdev) && !qemu_memfd_check()) {
+ } else if (vhost_dev_log_is_shared(hdev) && !qemu_memfd_alloc_check()) {
error_setg(&hdev->migration_blocker,
"Migration disabled: failed to allocate shared memory");
}