qemu-devel
[Top][All Lists]
Advanced

[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: Christian Borntraeger
Subject: Re: [Qemu-devel] [PATCH] vhost: Fix aborting if KVM does not support eventfds
Date: Mon, 16 Nov 2015 15:34:35 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

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 <address@hidden>
> ---
>  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");




reply via email to

[Prev in Thread] Current Thread [Next in Thread]