[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] vhost: Fix aborting if KVM does not support eve
From: |
Michael S. Tsirkin |
Subject: |
Re: [Qemu-devel] [PATCH] vhost: Fix aborting if KVM does not support eventfds |
Date: |
Mon, 16 Nov 2015 09:16:05 +0200 |
On Mon, Nov 16, 2015 at 10:02:07AM +0300, Pavel Fedin wrote:
> Hello!
>
> > > If you happen to have a stock kernel of old version, like 3.x, and you
> > > attempt to enable vhost by setting vhost=on, qemu aborts with error:
> > >
> > > kvm_mem_ioeventfd_add: error adding ioeventfd: Function not implemented
> > >
> > > This patch adds capability check, so that vhost gets disabled instead. A
> > > warning is displayed, explaining the reason.
> > >
> > > This problem can be observed with libvirt, which checks for /dev/vhost-net
> > > availability and just inserts "vhost=on" automatically in this case.
> > >
> > > Signed-off-by: Pavel Fedin <address@hidden>
> >
> > How come you have /dev/vhost-net though?
>
> Easily. Just enable CONFIG_VHOST_NET for the kernel. I happened to have it
> because i just copied over .config from another kernel
> version, which had ioeventfds working.
> CONFIG_VHOST_NET in the kernel depends on CONFIG_VHOST, which in turn
> depends on CONFIG_EVENTFD. But there's no direct dependency
> between it and CONFIG_HAVE_KVM_EVENTFD. So, you can just enable
> CONFIG_IOEVENTFD in "Configure standard kernel features", and get
> ioeventfds by themselves with vhost-net. Which, technically speaking, has no
> direct dependency on KVM's ability to bind ioeventfd to
> memory accesses. Because, theoretically, you could have some other use for it.
>
> > That was supposed to only be there if you have vhost-net,
> > and that never existed on kernels without eventfd.
>
> I believe distro maintainers (should) have taken care of it and disable it.
> But, as you can see, in some circumstances you could
> have it enabled. IMHO it's better to be more flexible and process this
> situation correctly. The fix is trivial.
>
> Kind regards,
> Pavel Fedin
> Expert Engineer
> Samsung Electronics Research center Russia
>
OK so it's a misconfigured kernel.
Fine but I'm not happy with silently using userspace instead.
If people ask for vhost they should get it.
How about
- kicking vhost from userspace
or
- failing vhost init
?
--
MST