[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 23/38] vhost-vdpa: Add qemu_close in vhost_vdpa_cleanup
From: |
Michael S. Tsirkin |
Subject: |
[PULL v2 23/38] vhost-vdpa: Add qemu_close in vhost_vdpa_cleanup |
Date: |
Tue, 3 Nov 2020 23:51:44 -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 v2 07/38] virito-mem: Implement get_min_alignment(), (continued)
- [PULL v2 07/38] virito-mem: Implement get_min_alignment(), Michael S. Tsirkin, 2020/11/03
- [PULL v2 06/38] memory-device: Add get_min_alignment() callback, Michael S. Tsirkin, 2020/11/03
- [PULL v2 08/38] hw/acpi : Don't use '#' flag of printf format, Michael S. Tsirkin, 2020/11/03
- [PULL v2 13/38] virtio-iommu: Fix virtio_iommu_mr(), Michael S. Tsirkin, 2020/11/03
- [PULL v2 15/38] virtio-iommu: Add memory notifiers for map/unmap, Michael S. Tsirkin, 2020/11/03
- [PULL v2 17/38] virtio-iommu: Add replay() memory region callback, Michael S. Tsirkin, 2020/11/03
- [PULL v2 19/38] memory: Add interface to set iommu page size mask, Michael S. Tsirkin, 2020/11/03
- [PULL v2 20/38] vfio: Set IOMMU page size as per host supported page size, Michael S. Tsirkin, 2020/11/03
- [PULL v2 21/38] virtio-iommu: Set supported page size mask, Michael S. Tsirkin, 2020/11/03
- [PULL v2 22/38] vfio: Don't issue full 2^64 unmap, Michael S. Tsirkin, 2020/11/03
- [PULL v2 23/38] vhost-vdpa: Add qemu_close in vhost_vdpa_cleanup,
Michael S. Tsirkin <=
- [PULL v2 09/38] hw/acpi : add space before the open parenthesis '(', Michael S. Tsirkin, 2020/11/03
- [PULL v2 24/38] net: Add vhost-vdpa in show_netdevs(), Michael S. Tsirkin, 2020/11/03
- [PULL v2 25/38] Revert "vhost-blk: set features before setting inflight feature", Michael S. Tsirkin, 2020/11/03
- [PULL v2 26/38] vhost-blk: set features before setting inflight feature, Michael S. Tsirkin, 2020/11/03
- [PULL v2 27/38] libvhost-user: follow QEMU comment style, Michael S. Tsirkin, 2020/11/03
- [PULL v2 29/38] block/export: make vhost-user-blk config space little-endian, Michael S. Tsirkin, 2020/11/03
- [PULL v2 11/38] hw/virtio/vhost-backend: Fix Coverity CID 1432871, Michael S. Tsirkin, 2020/11/03
- [PULL v2 30/38] block/export: fix vhost-user-blk get_config() information leak, Michael S. Tsirkin, 2020/11/03
- [PULL v2 12/38] hw/smbios: Fix leaked fd in save_opt_one() error path, Michael S. Tsirkin, 2020/11/03
- [PULL v2 14/38] virtio-iommu: Store memory region in endpoint struct, Michael S. Tsirkin, 2020/11/03