qemu-e2k/hw
Laurent Vivier 92099aa4e9 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: 8771589b6f ("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>
2023-06-26 09:50:00 -04:00
..
9pfs meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
acpi hw/acpi: Fix PM control register access 2023-06-26 09:49:24 -04:00
adc meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
alpha hw/alpha: Use MachineClass->default_nic in the alpha machine 2023-05-26 09:10:49 +02:00
arm meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
audio meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
avr
block hw/virtio: Build various target-agnostic objects just once 2023-06-23 02:54:44 -04:00
char meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
core meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
cpu meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
cris
cxl hw/cxl/events: Add event interrupt support 2023-06-22 18:55:14 -04:00
display meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
dma meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
gpio meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
hppa hw/hppa: Use MachineClass->default_nic in the hppa machine 2023-05-26 09:10:49 +02:00
hyperv win32: replace closesocket() with close() wrapper 2023-03-13 15:39:31 +04:00
i2c meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
i386 pc: q35: Bump max_cpus to 1024 2023-06-26 09:50:00 -04:00
ide meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
input meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
intc meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
ipack meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
ipmi meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
isa meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
loongarch hw/loongarch: Supplement cpu topology arguments 2023-06-16 17:58:46 +08:00
m68k q800: move macfb device to Q800MachineState 2023-06-22 09:30:11 +02:00
mem hw/cxl/events: Add injection of Memory Module Events 2023-06-23 02:54:40 -04:00
microblaze hw/char/xilinx_uartlite: Open-code xilinx_uartlite_create() 2023-02-27 13:27:05 +00:00
mips hw/mips/malta: Fix the malta machine on big endian hosts 2023-06-05 20:48:34 +02:00
misc mac_via: fix rtc command decoding for the PRAM seconds registers 2023-06-22 09:31:18 +02:00
net virtio-net: expose virtio_net_supported_guest_offloads() 2023-06-26 09:50:00 -04:00
nios2
nubus meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
nvme meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
nvram meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
openrisc *: Add missing includes of qemu/error-report.h 2023-03-22 15:06:57 +00:00
pci pci: ROM preallocation for incoming migration 2023-06-23 02:54:44 -04:00
pci-bridge meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
pci-host meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
pcmcia meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
ppc hw/ppc/Kconfig: MAC_NEWWORLD should always select USB_OHCI_PCI 2023-06-10 10:19:24 -03:00
rdma meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
remote meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
riscv riscv/virt: Support using pflash via -blockdev option 2023-06-13 17:39:45 +10:00
rtc meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
rx bulk: Remove pointless QOM casts 2023-06-05 20:48:34 +02:00
s390x hw/virtio: Remove unnecessary 'virtio-access.h' header 2023-06-23 02:54:44 -04:00
scsi hw/virtio: Build various target-agnostic objects just once 2023-06-23 02:54:44 -04:00
sd meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
sensor meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
sh4 hw/sh4: Use MachineClass->default_nic in the sh4 r2d machine 2023-05-22 09:44:48 +02:00
smbios meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
sparc bulk: Remove pointless QOM casts 2023-06-05 20:48:34 +02:00
sparc64 hw/char/parallel-isa: Export struct ISAParallelState 2023-06-13 11:28:58 +02:00
ssi meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
timer meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
tpm meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
tricore
usb meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
vfio hw/vfio: Add number of dirty pages to vfio_get_dirty_bitmap tracepoint 2023-06-13 11:28:58 +02:00
virtio vhost: fix vhost_dev_enable_notifiers() error case 2023-06-26 09:50:00 -04:00
watchdog meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
xen meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
xenpv hw/xenpv: Initialize Xen backend operations 2023-03-24 14:52:14 +00:00
xtensa hw/xtensa: Use MachineClass->default_nic in the virt machine 2023-05-26 09:10:49 +02:00
Kconfig xen: add CONFIG_XEN_BUS and CONFIG_XEN_EMU options for Xen emulation 2023-03-01 08:22:49 +00:00
meson.build