diff --git a/lib/nvmf/vfio_user.c b/lib/nvmf/vfio_user.c index ac8ae9081..5f9776734 100644 --- a/lib/nvmf/vfio_user.c +++ b/lib/nvmf/vfio_user.c @@ -1708,6 +1708,7 @@ nvmf_vfio_user_listen(struct spdk_nvmf_transport *transport, } free(path); + endpoint->fd = fd; err = ftruncate(fd, NVMF_VFIO_USER_DOORBELLS_OFFSET + NVMF_VFIO_USER_DOORBELLS_SIZE); if (err != 0) { goto out; @@ -1721,8 +1722,6 @@ nvmf_vfio_user_listen(struct spdk_nvmf_transport *transport, goto out; } - endpoint->fd = fd; - snprintf(uuid, PATH_MAX, "%s/cntrl", endpoint_id(endpoint)); endpoint->vfu_ctx = vfu_create_ctx(VFU_TRANS_SOCK, uuid, LIBVFIO_USER_FLAG_ATTACH_NB,