]> git.proxmox.com Git - pve-qemu.git/blob - debian/patches/extra/0011-vhost-fix-the-fd-leak.patch
31392fb9f8e953e2326c9d96e44c756e66bbdd63
[pve-qemu.git] / debian / patches / extra / 0011-vhost-fix-the-fd-leak.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Li Feng <fengli@smartx.com>
3 Date: Mon, 31 Jul 2023 20:10:06 +0800
4 Subject: [PATCH] vhost: fix the fd leak
5
6 When the vhost-user reconnect to the backend, the notifer should be
7 cleanup. Otherwise, the fd resource will be exhausted.
8
9 Fixes: f9a09ca3ea ("vhost: add support for configure interrupt")
10
11 Signed-off-by: Li Feng <fengli@smartx.com>
12 Reviewed-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
13 ---
14 hw/virtio/vhost.c | 2 ++
15 1 file changed, 2 insertions(+)
16
17 diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
18 index a266396576..8e3311781f 100644
19 --- a/hw/virtio/vhost.c
20 +++ b/hw/virtio/vhost.c
21 @@ -2034,6 +2034,8 @@ void vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice *vdev, bool vrings)
22 event_notifier_test_and_clear(
23 &hdev->vqs[VHOST_QUEUE_NUM_CONFIG_INR].masked_config_notifier);
24 event_notifier_test_and_clear(&vdev->config_notifier);
25 + event_notifier_cleanup(
26 + &hdev->vqs[VHOST_QUEUE_NUM_CONFIG_INR].masked_config_notifier);
27
28 trace_vhost_dev_stop(hdev, vdev->name, vrings);
29