From a0e38496e33699da1b96a34a3d947ccb0718db7e Mon Sep 17 00:00:00 2001 From: John Levon Date: Mon, 15 Feb 2021 15:21:47 +0000 Subject: 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 Reviewed-by: Thanos Makatos --- lib/libvfio-user.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'lib/libvfio-user.c') 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++) { -- cgit v1.1