diff options
author | swapnili <swapnil.ingle@nutanix.com> | 2021-02-10 17:54:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-10 17:54:51 +0100 |
commit | aa2157aad1876c3963efe34c694c93eadd309c97 (patch) | |
tree | a232b4ef5155eacb7a902603a20ec358e38cdee4 /include | |
parent | d3651f5d30a0532f39da962b9e76ba8cbada6e6c (diff) | |
download | libvfio-user-aa2157aad1876c3963efe34c694c93eadd309c97.zip libvfio-user-aa2157aad1876c3963efe34c694c93eadd309c97.tar.gz libvfio-user-aa2157aad1876c3963efe34c694c93eadd309c97.tar.bz2 |
API error return converged to one func (#325)
* API error return converged to one func
Use ERROR_INT() or ERROR_PTR() to return errors from API's.
This way if we want to change the behaviour later, we will just need
to update these funcitons.
Also fixed some error return cases and comments.
Reviewed-by: John Levon <john.levon@nutanix.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/libvfio-user.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/libvfio-user.h b/include/libvfio-user.h index 1cc62d9..62d4e77 100644 --- a/include/libvfio-user.h +++ b/include/libvfio-user.h @@ -546,7 +546,7 @@ vfu_addr_to_sg(vfu_ctx_t *vfu_ctx, dma_addr_t dma_addr, uint32_t len, * mapping * @cnt: number of scatter/gather entries to map * - * @returns 0 on success, -1 on failure + * @returns 0 on success, -1 on failure. Sets errno. */ int vfu_map_sg(vfu_ctx_t *vfu_ctx, const dma_sg_t *sg, @@ -573,6 +573,8 @@ vfu_unmap_sg(vfu_ctx_t *vfu_ctx, const dma_sg_t *sg, * @vfu_ctx: the libvfio-user context * @sg: a DMA segment obtained from dma_addr_to_sg * @data: data buffer to read into + * + * @returns 0 on success, -1 on failure. Sets errno. */ int vfu_dma_read(vfu_ctx_t *vfu_ctx, dma_sg_t *sg, void *data); @@ -583,6 +585,8 @@ vfu_dma_read(vfu_ctx_t *vfu_ctx, dma_sg_t *sg, void *data); * @vfu_ctx: the libvfio-user context * @sg: a DMA segment obtained from dma_addr_to_sg * @data: data buffer to write + * + * @returns 0 on success, -1 on failure. Sets errno. */ int vfu_dma_write(vfu_ctx_t *vfu_ctx, dma_sg_t *sg, void *data); |