aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJohn Levon <john.levon@nutanix.com>2021-02-11 20:39:34 +0000
committerGitHub <noreply@github.com>2021-02-11 20:39:34 +0000
commit0cfb9449dc1469cb8b12369afc2c5881d6b544fd (patch)
treed9ec0f63da620e6c342a959027a083c98ace0e54 /lib
parentce35c1da0add92c690ea6ab77e1ef3d7cbba28f5 (diff)
downloadlibvfio-user-0cfb9449dc1469cb8b12369afc2c5881d6b544fd.zip
libvfio-user-0cfb9449dc1469cb8b12369afc2c5881d6b544fd.tar.gz
libvfio-user-0cfb9449dc1469cb8b12369afc2c5881d6b544fd.tar.bz2
tiny rename of vfu_ctx_t::trans -> tran (#315)
This matches the tran_* namespace better. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/irq.c8
-rw-r--r--lib/libvfio-user.c34
-rw-r--r--lib/private.h2
3 files changed, 22 insertions, 22 deletions
diff --git a/lib/irq.c b/lib/irq.c
index 4cc812b..5cc0cd2 100644
--- a/lib/irq.c
+++ b/lib/irq.c
@@ -420,10 +420,10 @@ vfu_irq_message(vfu_ctx_t *vfu_ctx, uint32_t subindex)
}
irq_info.subindex = subindex;
- ret = vfu_ctx->trans->send_msg(vfu_ctx, msg_id,
- VFIO_USER_VM_INTERRUPT,
- &irq_info, sizeof irq_info,
- NULL, NULL, 0);
+ ret = vfu_ctx->tran->send_msg(vfu_ctx, msg_id,
+ VFIO_USER_VM_INTERRUPT,
+ &irq_info, sizeof irq_info,
+ NULL, NULL, 0);
if (ret < 0) {
return ERROR_INT(-ret);
}
diff --git a/lib/libvfio-user.c b/lib/libvfio-user.c
index 3192fd8..4d37a5d 100644
--- a/lib/libvfio-user.c
+++ b/lib/libvfio-user.c
@@ -696,7 +696,7 @@ get_next_command(vfu_ctx_t *vfu_ctx, struct vfio_user_header *hdr, int *fds,
int ret;
/* FIXME get request shouldn't set errno, it should return it as -errno */
- ret = vfu_ctx->trans->get_request(vfu_ctx, hdr, fds, nr_fds);
+ ret = vfu_ctx->tran->get_request(vfu_ctx, hdr, fds, nr_fds);
if (unlikely(ret < 0)) {
if (ret == -EAGAIN || ret == -EWOULDBLOCK) {
return 0;
@@ -934,8 +934,8 @@ process_request(vfu_ctx_t *vfu_ctx)
*/
ret = 0;
} else {
- ret = vfu_ctx->trans->reply(vfu_ctx, hdr.msg_id, iovecs, nr_iovecs,
- fds_out, nr_fds_out, -ret);
+ ret = vfu_ctx->tran->reply(vfu_ctx, hdr.msg_id, iovecs, nr_iovecs,
+ fds_out, nr_fds_out, -ret);
if (unlikely(ret < 0)) {
vfu_log(vfu_ctx, LOG_ERR, "failed to reply: %s", strerror(-ret));
}
@@ -1081,12 +1081,12 @@ vfu_destroy_ctx(vfu_ctx_t *vfu_ctx)
free(vfu_ctx->uuid);
free(vfu_ctx->pci.config_space);
- if (vfu_ctx->trans->detach != NULL) {
- vfu_ctx->trans->detach(vfu_ctx);
+ if (vfu_ctx->tran->detach != NULL) {
+ vfu_ctx->tran->detach(vfu_ctx);
}
- if (vfu_ctx->trans->fini != NULL) {
- vfu_ctx->trans->fini(vfu_ctx);
+ if (vfu_ctx->tran->fini != NULL) {
+ vfu_ctx->tran->fini(vfu_ctx);
}
if (vfu_ctx->dma != NULL) {
@@ -1114,7 +1114,7 @@ vfu_attach_ctx(vfu_ctx_t *vfu_ctx)
assert(vfu_ctx != NULL);
- return vfu_ctx->trans->attach(vfu_ctx);
+ return vfu_ctx->tran->attach(vfu_ctx);
}
vfu_ctx_t *
@@ -1143,7 +1143,7 @@ vfu_create_ctx(vfu_trans_t trans, const char *path, int flags, void *pvt,
vfu_ctx->fd = -1;
vfu_ctx->conn_fd = -1;
vfu_ctx->dev_type = dev_type;
- vfu_ctx->trans = &tran_sock_ops;
+ vfu_ctx->tran = &tran_sock_ops;
vfu_ctx->pvt = pvt;
vfu_ctx->flags = flags;
vfu_ctx->log_level = LOG_ERR;
@@ -1175,8 +1175,8 @@ vfu_create_ctx(vfu_trans_t trans, const char *path, int flags, void *pvt,
goto err_out;
}
- if (vfu_ctx->trans->init != NULL) {
- err = vfu_ctx->trans->init(vfu_ctx);
+ if (vfu_ctx->tran->init != NULL) {
+ err = vfu_ctx->tran->init(vfu_ctx);
if (err < 0) {
goto err_out;
}
@@ -1495,9 +1495,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 = vfu_ctx->trans->send_msg(vfu_ctx, msg_id, VFIO_USER_DMA_READ,
- &dma_send, sizeof dma_send, NULL,
- dma_recv, recv_size);
+ ret = vfu_ctx->tran->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);
@@ -1521,9 +1521,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 = vfu_ctx->trans->send_msg(vfu_ctx, msg_id, VFIO_USER_DMA_WRITE,
- dma_send, send_size, NULL,
- &dma_recv, sizeof(dma_recv));
+ ret = vfu_ctx->tran->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 < 0 ? ERROR_INT(-ret) : 0;
diff --git a/lib/private.h b/lib/private.h
index 829bc3a..be5cf6d 100644
--- a/lib/private.h
+++ b/lib/private.h
@@ -122,7 +122,7 @@ struct vfu_ctx {
size_t nr_regions;
vfu_reg_info_t *reg_info;
struct pci_dev pci;
- struct transport_ops *trans;
+ struct transport_ops *tran;
uint64_t flags;
char *uuid;
vfu_map_dma_cb_t *map_dma;