qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Pavel Fedin <p.fedin@samsung.com>, qemu-devel@nongnu.org
Cc: "'Michael S. Tsirkin'" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] vhost: Fix aborting if KVM does not support eventfds
Date: Mon, 16 Nov 2015 15:34:35 +0100	[thread overview]
Message-ID: <5649E97B.4040905@de.ibm.com> (raw)
In-Reply-To: <002301d11df5$9d440a10$d7cc1e30$@samsung.com>

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 <p.fedin@samsung.com>
> ---
>  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");

      parent reply	other threads:[~2015-11-16 14:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-13  9:28 [Qemu-devel] [PATCH] vhost: Fix aborting if KVM does not support eventfds Pavel Fedin
2015-11-14 19:18 ` Michael S. Tsirkin
2015-11-16  7:02   ` Pavel Fedin
2015-11-16  7:16     ` Michael S. Tsirkin
2015-11-16  7:31       ` Pavel Fedin
2015-11-16 14:34 ` Christian Borntraeger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5649E97B.4040905@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=mst@redhat.com \
    --cc=p.fedin@samsung.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).