qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] vhost: fix vhost_dev_enable_notifiers() error case


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH] vhost: fix vhost_dev_enable_notifiers() error case
Date: Fri, 2 Jun 2023 21:59:29 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.0

On 2/6/23 18:27, Laurent Vivier wrote:
in vhost_dev_enable_notifiers(), if virtio_bus_set_host_notifier(true)
fails, we call vhost_dev_disable_notifiers() that executes
virtio_bus_set_host_notifier(false) on all queues, even on queues that
have failed to be initialized.

This triggers a core dump in memory_region_del_eventfd():

  virtio_bus_set_host_notifier: unable to init event notifier: Too many open 
files (-24)
  vhost VQ 1 notifier binding failed: 24
  .../softmmu/memory.c:2611: memory_region_del_eventfd: Assertion `i != 
mr->ioeventfd_nb' failed.

Fix the problem by providing to vhost_dev_disable_notifiers() the
number of queues to disable.

Fixes: 8771589b6f81 ("vhost: simplify vhost_dev_enable_notifiers")
Cc: longpeng2@huawei.com
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
  hw/virtio/vhost.c | 65 ++++++++++++++++++++++++++---------------------
  1 file changed, 36 insertions(+), 29 deletions(-)

I'd rather have 2 patches, one factoring the new helper out
and the 2nd fixing the bug. If you ever need to respin...
Anyhow,

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>




reply via email to

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