[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v3 23/31] vhost-vdpa: Add qemu_close in vhost_vdpa_cleanup
From: |
Michael S. Tsirkin |
Subject: |
[PULL v3 23/31] vhost-vdpa: Add qemu_close in vhost_vdpa_cleanup |
Date: |
Wed, 4 Nov 2020 13:42:22 -0500 |
From: Cindy Lu <lulu@redhat.com>
fix the bug that fd will still open after the cleanup
Signed-off-by: Cindy Lu <lulu@redhat.com>
Message-Id: <20201016030909.9522-1-lulu@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
net/vhost-vdpa.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index 99c476db8c..fe659ec9e2 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -145,6 +145,10 @@ static void vhost_vdpa_cleanup(NetClientState *nc)
g_free(s->vhost_net);
s->vhost_net = NULL;
}
+ if (s->vhost_vdpa.device_fd >= 0) {
+ qemu_close(s->vhost_vdpa.device_fd);
+ s->vhost_vdpa.device_fd = -1;
+ }
}
static bool vhost_vdpa_has_vnet_hdr(NetClientState *nc)
--
MST
- [PULL v3 12/31] hw/smbios: Fix leaked fd in save_opt_one() error path, (continued)
- [PULL v3 12/31] hw/smbios: Fix leaked fd in save_opt_one() error path, Michael S. Tsirkin, 2020/11/04
- [PULL v3 13/31] virtio-iommu: Fix virtio_iommu_mr(), Michael S. Tsirkin, 2020/11/04
- [PULL v3 14/31] virtio-iommu: Store memory region in endpoint struct, Michael S. Tsirkin, 2020/11/04
- [PULL v3 15/31] virtio-iommu: Add memory notifiers for map/unmap, Michael S. Tsirkin, 2020/11/04
- [PULL v3 16/31] virtio-iommu: Call memory notifiers in attach/detach, Michael S. Tsirkin, 2020/11/04
- [PULL v3 17/31] virtio-iommu: Add replay() memory region callback, Michael S. Tsirkin, 2020/11/04
- [PULL v3 19/31] memory: Add interface to set iommu page size mask, Michael S. Tsirkin, 2020/11/04
- [PULL v3 20/31] vfio: Set IOMMU page size as per host supported page size, Michael S. Tsirkin, 2020/11/04
- [PULL v3 21/31] virtio-iommu: Set supported page size mask, Michael S. Tsirkin, 2020/11/04
- [PULL v3 22/31] vfio: Don't issue full 2^64 unmap, Michael S. Tsirkin, 2020/11/04
- [PULL v3 23/31] vhost-vdpa: Add qemu_close in vhost_vdpa_cleanup,
Michael S. Tsirkin <=
- [PULL v3 24/31] net: Add vhost-vdpa in show_netdevs(), Michael S. Tsirkin, 2020/11/04
- [PULL v3 25/31] Revert "vhost-blk: set features before setting inflight feature", Michael S. Tsirkin, 2020/11/04
- [PULL v3 26/31] vhost-blk: set features before setting inflight feature, Michael S. Tsirkin, 2020/11/04
- [PULL v3 27/31] libvhost-user: follow QEMU comment style, Michael S. Tsirkin, 2020/11/04
- [PULL v3 28/31] configure: introduce --enable-vhost-user-blk-server, Michael S. Tsirkin, 2020/11/04
- [PULL v3 29/31] block/export: make vhost-user-blk config space little-endian, Michael S. Tsirkin, 2020/11/04
- [PULL v3 30/31] block/export: fix vhost-user-blk get_config() information leak, Michael S. Tsirkin, 2020/11/04
- [PULL v3 31/31] contrib/vhost-user-blk: fix get_config() information leak, Michael S. Tsirkin, 2020/11/04
- [PULL v3 18/31] virtio-iommu: Add notify_flag_changed() memory region callback, Michael S. Tsirkin, 2020/11/04
- [PULL v3 10/31] hw/acpi : add spaces around operator, Michael S. Tsirkin, 2020/11/04