summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLi Qiang2018-12-15 13:03:52 +0100
committerMichael S. Tsirkin2019-01-15 01:31:04 +0100
commitb0aa77d36d9150aaa7acd8b86e4e65162939d0bf (patch)
tree3dbd01db77d39daa779dbeba6df13066b95ee2a0
parenttests: vhost-user-test: initialize 'fd' in chr_read (diff)
downloadqemu-b0aa77d36d9150aaa7acd8b86e4e65162939d0bf.tar.gz
qemu-b0aa77d36d9150aaa7acd8b86e4e65162939d0bf.tar.xz
qemu-b0aa77d36d9150aaa7acd8b86e4e65162939d0bf.zip
vhost-user: fix ioeventfd_enabled
Currently, the vhost-user-test assumes the eventfd is available. However it's not true because the accel is qtest. So the 'vhost_set_vring_file' will not add fds to the msg and the server side of vhost-user-test will be broken. The bug is in 'ioeventfd_enabled'. We should make this function return true if not using kvm accel. Signed-off-by: Li Qiang <liq3ea@163.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r--hw/virtio/vhost-user.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
index e09bed0e4a..564a31d12c 100644
--- a/hw/virtio/vhost-user.c
+++ b/hw/virtio/vhost-user.c
@@ -207,7 +207,7 @@ struct vhost_user {
static bool ioeventfd_enabled(void)
{
- return kvm_enabled() && kvm_eventfds_enabled();
+ return !kvm_enabled() || kvm_eventfds_enabled();
}
static int vhost_user_read(struct vhost_dev *dev, VhostUserMsg *msg)