From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40366) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyKrk-0005r3-QP for qemu-devel@nongnu.org; Mon, 16 Nov 2015 09:34:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZyKrg-0003D8-Is for qemu-devel@nongnu.org; Mon, 16 Nov 2015 09:34:44 -0500 Received: from e06smtp11.uk.ibm.com ([195.75.94.107]:32830) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyKrg-0003Cc-9F for qemu-devel@nongnu.org; Mon, 16 Nov 2015 09:34:40 -0500 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 16 Nov 2015 14:34:38 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 0C31C17D8042 for ; Mon, 16 Nov 2015 14:34:57 +0000 (GMT) Received: from d06av08.portsmouth.uk.ibm.com (d06av08.portsmouth.uk.ibm.com [9.149.37.249]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id tAGEYZ5i8126814 for ; Mon, 16 Nov 2015 14:34:35 GMT Received: from d06av08.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id tAGEYZNw007472 for ; Mon, 16 Nov 2015 07:34:35 -0700 References: <002301d11df5$9d440a10$d7cc1e30$@samsung.com> From: Christian Borntraeger Message-ID: <5649E97B.4040905@de.ibm.com> Date: Mon, 16 Nov 2015 15:34:35 +0100 MIME-Version: 1.0 In-Reply-To: <002301d11df5$9d440a10$d7cc1e30$@samsung.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] vhost: Fix aborting if KVM does not support eventfds List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Fedin , qemu-devel@nongnu.org Cc: "'Michael S. Tsirkin'" On 11/13/2015 10:28 AM, Pavel Fedin wrote: > 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 > --- > hw/virtio/vhost.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c > index 1794f0d..3121e19 100644 > --- a/hw/virtio/vhost.c > +++ b/hw/virtio/vhost.c > @@ -24,6 +24,7 @@ > #include "hw/virtio/virtio-bus.h" > #include "hw/virtio/virtio-access.h" > #include "migration/migration.h" > +#include "sysemu/kvm.h" > > static struct vhost_log *vhost_log; > static struct vhost_log *vhost_log_shm; > @@ -1083,6 +1084,11 @@ int vhost_dev_enable_notifiers(struct vhost_dev *hdev, VirtIODevice *vdev) > r = -ENOSYS; > goto fail; > } > + if (!kvm_eventfds_enabled()) { > + error_report("KVM does not support MMIO eventfds"); We also have virtio-ccw. what about something without MMIO like error_report("KVM does not support eventfds");