diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2025-01-30 17:52:11 +1100 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2025-02-03 07:32:51 +0100 |
commit | 0349cf637f64a5128846c79d9537849e1ed3e1cc (patch) | |
tree | b66e907e90ccea5a8527397b67a5670a40fb28d5 /util.c | |
parent | 10c4a9e1b383becd7366bda986f886675f7c4cb2 (diff) | |
download | passt-0349cf637f64a5128846c79d9537849e1ed3e1cc.tar passt-0349cf637f64a5128846c79d9537849e1ed3e1cc.tar.gz passt-0349cf637f64a5128846c79d9537849e1ed3e1cc.tar.bz2 passt-0349cf637f64a5128846c79d9537849e1ed3e1cc.tar.lz passt-0349cf637f64a5128846c79d9537849e1ed3e1cc.tar.xz passt-0349cf637f64a5128846c79d9537849e1ed3e1cc.tar.zst passt-0349cf637f64a5128846c79d9537849e1ed3e1cc.zip |
util: Rename and make global vu_remove_watch()
vu_remove_watch() is used in vhost_user.c to remove an fd from the global
epoll set. There's nothing really vhost user specific about it though,
so rename, move to util.c and use it in a bunch of places outside
vhost_user.c where it makes things marginally more readable.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -837,3 +837,13 @@ void raw_random(void *buf, size_t buflen) if (random_read < buflen) die("Unexpected EOF on random data source"); } + +/** + * epoll_del() - Remove a file descriptor from our passt epoll + * @c: Execution context + * @fd: File descriptor to remove + */ +void epoll_del(const struct ctx *c, int fd) +{ + epoll_ctl(c->epollfd, EPOLL_CTL_DEL, fd, NULL); +} |