aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSwapnil Ingle <swapnil.ingle@nutanix.com>2021-05-14 22:32:59 +0200
committerGitHub <noreply@github.com>2021-05-14 22:32:59 +0200
commit95f16fceadba22a7730c2a9c94cfd4028ef04a02 (patch)
treec8828c2c495ad1897cc9ed0d1776c48f9258508a /lib
parent83eb5d9c02f7bdbeaf8eb2e21a39c92c715351a4 (diff)
downloadlibvfio-user-95f16fceadba22a7730c2a9c94cfd4028ef04a02.zip
libvfio-user-95f16fceadba22a7730c2a9c94cfd4028ef04a02.tar.gz
libvfio-user-95f16fceadba22a7730c2a9c94cfd4028ef04a02.tar.bz2
Fix dma read write count (#497)
* spec: Fixed DMA_READ/WRITE data count DMA region size is maxed to uint64_t. Updated DMA_READ/WRITE data count to be defined as uint64_t. * Fix vfu_dma_read/write() as per spec changes Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/libvfio-user.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libvfio-user.c b/lib/libvfio-user.c
index 9c32c73..4a03995 100644
--- a/lib/libvfio-user.c
+++ b/lib/libvfio-user.c
@@ -1502,7 +1502,7 @@ vfu_dma_read(vfu_ctx_t *vfu_ctx, dma_sg_t *sg, void *data)
{
struct vfio_user_dma_region_access *dma_recv;
struct vfio_user_dma_region_access dma_send;
- int recv_size;
+ uint64_t recv_size;
int msg_id = 1, ret;
assert(vfu_ctx != NULL);
@@ -1543,7 +1543,7 @@ int
vfu_dma_write(vfu_ctx_t *vfu_ctx, dma_sg_t *sg, void *data)
{
struct vfio_user_dma_region_access *dma_send, dma_recv;
- int send_size = sizeof(*dma_send) + sg->length;
+ uint64_t send_size = sizeof(*dma_send) + sg->length;
int msg_id = 1, ret;
assert(vfu_ctx != NULL);