aboutsummaryrefslogtreecommitdiff
path: root/lib/libvfio-user.c
diff options
context:
space:
mode:
authorJohn Levon <john.levon@nutanix.com>2021-02-09 16:28:00 +0000
committerGitHub <noreply@github.com>2021-02-09 16:28:00 +0000
commit1f2f31da25baf794610df251b2df7a127f9cf5f2 (patch)
tree4adf35c66638adf3ab041e0560355fd6e6f65aa6 /lib/libvfio-user.c
parent2358bc9c610a50c542b3cb33a8eba0363c9e5315 (diff)
downloadlibvfio-user-1f2f31da25baf794610df251b2df7a127f9cf5f2.zip
libvfio-user-1f2f31da25baf794610df251b2df7a127f9cf5f2.tar.gz
libvfio-user-1f2f31da25baf794610df251b2df7a127f9cf5f2.tar.bz2
introduce transport send_msg() handler (#314)
Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'lib/libvfio-user.c')
-rw-r--r--lib/libvfio-user.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/libvfio-user.c b/lib/libvfio-user.c
index 98ddef3..868af07 100644
--- a/lib/libvfio-user.c
+++ b/lib/libvfio-user.c
@@ -1445,9 +1445,9 @@ vfu_dma_read(vfu_ctx_t *vfu_ctx, dma_sg_t *sg, void *data)
dma_send.addr = sg->dma_addr;
dma_send.count = sg->length;
- ret = tran_sock_msg(vfu_ctx->conn_fd, msg_id, VFIO_USER_DMA_READ,
- &dma_send, sizeof dma_send, NULL,
- dma_recv, recv_size);
+ ret = vfu_ctx->trans->send_msg(vfu_ctx, msg_id, VFIO_USER_DMA_READ,
+ &dma_send, sizeof dma_send, NULL,
+ dma_recv, recv_size);
memcpy(data, dma_recv->data, sg->length); /* FIXME no need for memcpy */
free(dma_recv);
@@ -1471,9 +1471,9 @@ vfu_dma_write(vfu_ctx_t *vfu_ctx, dma_sg_t *sg, void *data)
dma_send->addr = sg->dma_addr;
dma_send->count = sg->length;
memcpy(dma_send->data, data, sg->length); /* FIXME no need to copy! */
- ret = tran_sock_msg(vfu_ctx->conn_fd, msg_id, VFIO_USER_DMA_WRITE,
- dma_send, send_size, NULL,
- &dma_recv, sizeof(dma_recv));
+ ret = vfu_ctx->trans->send_msg(vfu_ctx, msg_id, VFIO_USER_DMA_WRITE,
+ dma_send, send_size, NULL,
+ &dma_recv, sizeof(dma_recv));
free(dma_send);
return ret;