summary refs log tree commit diff stats
path: root/hw/net/virtio-net.c
diff options
context:
space:
mode:
authorLaurent Vivier <lvivier@redhat.com>2023-06-02 18:27:35 +0200
committerMichael S. Tsirkin <mst@redhat.com>2023-06-26 09:50:00 -0400
commit92099aa4e9a3bb6856c290afaf41c76f9e3dd9fd (patch)
tree5e78b08a09d529e55f36a04fb32034344e8a4131 /hw/net/virtio-net.c
parent4b4a1378b951930628398b3c67ccb036bdf6f012 (diff)
downloadfocaccia-qemu-92099aa4e9a3bb6856c290afaf41c76f9e3dd9fd.tar.gz
focaccia-qemu-92099aa4e9a3bb6856c290afaf41c76f9e3dd9fd.zip
vhost: fix vhost_dev_enable_notifiers() error case
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>
Message-Id: <20230602162735.3670785-1-lvivier@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Diffstat (limited to 'hw/net/virtio-net.c')
0 files changed, 0 insertions, 0 deletions