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: Michael Tokarev
Subject: Re: [PATCH] vhost: fix vhost_dev_enable_notifiers() error case
Date: Wed, 7 Jun 2023 12:32:31 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0

02.06.2023 19: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(-)

Is this one a candidate for -stable?

The diffstat is somewhat large but it is just moving bit of code around.

Thanks,

/mjt



reply via email to

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