diff options
author | Thanos Makatos <thanos.makatos@nutanix.com> | 2020-11-27 11:45:18 -0500 |
---|---|---|
committer | Thanos <tmakatos@gmail.com> | 2020-12-01 15:41:25 +0000 |
commit | e34f5b118b7400d987ecae1f3b53eca27074d279 (patch) | |
tree | 65c772f6b5207d33e11a11130257545302c743bc /lib/private.h | |
parent | 9e01633253c24d7f15be36c8edd5d192601d1795 (diff) | |
download | libvfio-user-e34f5b118b7400d987ecae1f3b53eca27074d279.zip libvfio-user-e34f5b118b7400d987ecae1f3b53eca27074d279.tar.gz libvfio-user-e34f5b118b7400d987ecae1f3b53eca27074d279.tar.bz2 |
don't leak passed file descriptors on failure
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'lib/private.h')
-rw-r--r-- | lib/private.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/private.h b/lib/private.h index 7ffe099..22c6807 100644 --- a/lib/private.h +++ b/lib/private.h @@ -47,7 +47,7 @@ struct transport_ops { int (*attach)(vfu_ctx_t*); int(*detach)(vfu_ctx_t*); int (*get_request)(vfu_ctx_t*, struct vfio_user_header*, - int *fds, int *nr_fds); + int *fds, size_t *nr_fds); }; typedef enum { @@ -143,13 +143,26 @@ region_to_offset(uint32_t region); int handle_dma_map_or_unmap(vfu_ctx_t *vfu_ctx, uint32_t size, bool map, - int *fds, int nr_fds, + int *fds, size_t *nr_fds, struct vfio_user_dma_region *dma_regions); void _dma_controller_do_remove_region(dma_controller_t *dma, dma_memory_region_t *region); +int +get_next_command(vfu_ctx_t *vfu_ctx, struct vfio_user_header *hdr, int *fds, + size_t *nr_fds); + +int +exec_command(vfu_ctx_t *vfu_ctx, struct vfio_user_header *hdr, size_t size, + int *fds, size_t *nr_fds, + struct iovec *_iovecs, struct iovec **iovecs, size_t *nr_iovecs, + bool *free_iovec_data); + +int +process_request(vfu_ctx_t *vfu_ctx); + #endif /* LIB_VFIO_USER_PRIVATE_H */ /* ex: set tabstop=4 shiftwidth=4 softtabstop=4 expandtab: */ |