From: dave@treblig.org
To: peterx@redhat.com, farosas@suse.de, eblake@redhat.com, armbru@redhat.com
Cc: qemu-devel@nongnu.org, "Dr. David Alan Gilbert" <dave@treblig.org>
Subject: [PATCH v2 7/7] util/userfaultfd: Remove unused uffd_poll_events
Date: Thu, 19 Sep 2024 14:46:26 +0100 [thread overview]
Message-ID: <20240919134626.166183-8-dave@treblig.org> (raw)
In-Reply-To: <20240919134626.166183-1-dave@treblig.org>
From: "Dr. David Alan Gilbert" <dave@treblig.org>
uffd_poll_events has been unused since it was added; it's also
just a wrapper around a plain old poll call, so doesn't add anything.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
---
include/qemu/userfaultfd.h | 1 -
util/userfaultfd.c | 28 ----------------------------
2 files changed, 29 deletions(-)
diff --git a/include/qemu/userfaultfd.h b/include/qemu/userfaultfd.h
index 18a4314212..a1979308d7 100644
--- a/include/qemu/userfaultfd.h
+++ b/include/qemu/userfaultfd.h
@@ -39,7 +39,6 @@ int uffd_copy_page(int uffd_fd, void *dst_addr, void *src_addr,
int uffd_zero_page(int uffd_fd, void *addr, uint64_t length, bool dont_wake);
int uffd_wakeup(int uffd_fd, void *addr, uint64_t length);
int uffd_read_events(int uffd_fd, struct uffd_msg *msgs, int count);
-bool uffd_poll_events(int uffd_fd, int tmo);
#endif /* CONFIG_LINUX */
diff --git a/util/userfaultfd.c b/util/userfaultfd.c
index 518d5c3586..2396104f23 100644
--- a/util/userfaultfd.c
+++ b/util/userfaultfd.c
@@ -358,31 +358,3 @@ int uffd_read_events(int uffd_fd, struct uffd_msg *msgs, int count)
return (int) (res / sizeof(struct uffd_msg));
}
-
-/**
- * uffd_poll_events: poll UFFD file descriptor for read
- *
- * Returns true if events are available for read, false otherwise
- *
- * @uffd_fd: UFFD file descriptor
- * @tmo: timeout value
- */
-bool uffd_poll_events(int uffd_fd, int tmo)
-{
- int res;
- struct pollfd poll_fd = { .fd = uffd_fd, .events = POLLIN, .revents = 0 };
-
- do {
- res = poll(&poll_fd, 1, tmo);
- } while (res < 0 && errno == EINTR);
-
- if (res == 0) {
- return false;
- }
- if (res < 0) {
- error_report("uffd_poll_events() failed: errno=%i", errno);
- return false;
- }
-
- return (poll_fd.revents & POLLIN) != 0;
-}
--
2.46.1
next prev parent reply other threads:[~2024-09-19 13:50 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-19 13:46 [PATCH v2 0/7] Migration deadcode removal dave
2024-09-19 13:46 ` [PATCH v2 1/7] migration: Remove migrate_cap_set dave
2024-09-19 13:46 ` [PATCH v2 2/7] migration: Remove unused migrate_zero_blocks dave
2024-09-19 17:45 ` Peter Xu
2024-09-19 13:46 ` [PATCH v2 3/7] migration: Deprecate zero-blocks capability dave
2024-09-19 17:45 ` Peter Xu
2024-09-19 13:46 ` [PATCH v2 4/7] migration: Remove unused socket_send_channel_create_sync dave
2024-09-19 13:46 ` [PATCH v2 5/7] util/userfaultfd: Return -errno on error dave
2024-09-19 17:46 ` Peter Xu
2024-09-19 13:46 ` [PATCH v2 6/7] migration/postcopy: Use uffd helpers dave
2024-09-19 17:44 ` Peter Xu
2024-09-30 19:51 ` Peter Xu
2024-09-30 20:23 ` Dr. David Alan Gilbert
2024-09-19 13:46 ` dave [this message]
2024-09-19 17:44 ` [PATCH v2 7/7] util/userfaultfd: Remove unused uffd_poll_events Peter Xu
2024-09-20 15:34 ` [PATCH v2 0/7] Migration deadcode removal Peter Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240919134626.166183-8-dave@treblig.org \
--to=dave@treblig.org \
--cc=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=farosas@suse.de \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).