aboutsummaryrefslogtreecommitdiff
path: root/lib/libvfio-user.c
diff options
context:
space:
mode:
authorJohn Levon <john.levon@nutanix.com>2021-02-15 15:21:47 +0000
committerGitHub <noreply@github.com>2021-02-15 15:21:47 +0000
commita0e38496e33699da1b96a34a3d947ccb0718db7e (patch)
tree7fe78e0300017c01e52696e46afe7cc892916f2e /lib/libvfio-user.c
parent33430ae0968c548427258cdc726861fd4daa2637 (diff)
downloadlibvfio-user-a0e38496e33699da1b96a34a3d947ccb0718db7e.zip
libvfio-user-a0e38496e33699da1b96a34a3d947ccb0718db7e.tar.gz
libvfio-user-a0e38496e33699da1b96a34a3d947ccb0718db7e.tar.bz2
make file descriptors private to the transport (#321)
General code has no business knowing about the socket file descriptors. vfu_attach_ctx() is changed to not return the file descriptor; we'll re-expose a suitable file descriptor in a follow-up 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.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/libvfio-user.c b/lib/libvfio-user.c
index c36a4da..738d3b7 100644
--- a/lib/libvfio-user.c
+++ b/lib/libvfio-user.c
@@ -1143,10 +1143,9 @@ vfu_create_ctx(vfu_trans_t trans, const char *path, int flags, void *pvt,
return ERROR_PTR(ENOMEM);
}
- vfu_ctx->fd = -1;
- vfu_ctx->conn_fd = -1;
vfu_ctx->dev_type = dev_type;
vfu_ctx->tran = &tran_sock_ops;
+ vfu_ctx->tran_data = NULL;
vfu_ctx->pvt = pvt;
vfu_ctx->flags = flags;
vfu_ctx->log_level = LOG_ERR;
@@ -1183,7 +1182,6 @@ vfu_create_ctx(vfu_trans_t trans, const char *path, int flags, void *pvt,
if (err < 0) {
goto err_out;
}
- vfu_ctx->fd = err;
}
for (i = 0; i< vfu_ctx->nr_regions; i++) {