aboutsummaryrefslogtreecommitdiff
path: root/include/libvfio-user.h
diff options
context:
space:
mode:
authorJohn Levon <john.levon@nutanix.com>2021-02-15 15:40:21 +0000
committerGitHub <noreply@github.com>2021-02-15 15:40:21 +0000
commit62b681a42879db18ee7c8b64e750b639a92f6f8d (patch)
tree0bd8a4943b81db8b2e82680c41a67f653b35ee6c /include/libvfio-user.h
parenta0e38496e33699da1b96a34a3d947ccb0718db7e (diff)
downloadlibvfio-user-62b681a42879db18ee7c8b64e750b639a92f6f8d.zip
libvfio-user-62b681a42879db18ee7c8b64e750b639a92f6f8d.tar.gz
libvfio-user-62b681a42879db18ee7c8b64e750b639a92f6f8d.tar.bz2
add vfu_get_poll_fd() (#322)
Library users can use this to sleep on either a newly-attached socket client, or a new message. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'include/libvfio-user.h')
-rw-r--r--include/libvfio-user.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/libvfio-user.h b/include/libvfio-user.h
index 11666d0..68307cb 100644
--- a/include/libvfio-user.h
+++ b/include/libvfio-user.h
@@ -130,6 +130,13 @@ int
vfu_attach_ctx(vfu_ctx_t *vfu_ctx);
/**
+ * Return a file descriptor suitable for waiting on via epoll() or similar. This
+ * should not be cached, as it may change after a successful vfu_attach_ctx().
+ */
+int
+vfu_get_poll_fd(vfu_ctx_t *vfu_ctx);
+
+/**
* Polls the vfu_ctx and processes the command recieved from client.
* - Blocking vfu_ctx:
* Blocks until new request is received from client and continues processing