summary refs log tree commit diff
path: root/sys_util
diff options
context:
space:
mode:
authorZach Reizner <zachr@google.com>2018-02-26 14:38:40 -0800
committerchrome-bot <chrome-bot@chromium.org>2018-03-08 19:28:52 -0800
commitd604dbbab4d3acbf9b3184e991c121505b517f5d (patch)
tree3f4474ead739a9f1b08b8e6adcda6cfe78de4868 /sys_util
parent7c2238bd15ec8b027c5508a05272e79b4bb44607 (diff)
downloadcrosvm-d604dbbab4d3acbf9b3184e991c121505b517f5d.tar
crosvm-d604dbbab4d3acbf9b3184e991c121505b517f5d.tar.gz
crosvm-d604dbbab4d3acbf9b3184e991c121505b517f5d.tar.bz2
crosvm-d604dbbab4d3acbf9b3184e991c121505b517f5d.tar.lz
crosvm-d604dbbab4d3acbf9b3184e991c121505b517f5d.tar.xz
crosvm-d604dbbab4d3acbf9b3184e991c121505b517f5d.tar.zst
crosvm-d604dbbab4d3acbf9b3184e991c121505b517f5d.zip
crosvm/plugin: refactor poll loop to use PollContext
This change simplifies plugin processing by removing the awkward
run_until_started loop. This also switches to use PollContext instead
of the Poller/Pollable interface, which required reallocating a Vec
every loop to satisfy the borrow checker.

TEST=cargo test --features plugin
BUG=chromium:816692

Change-Id: Iedf26a32840a9a038205c4be8d1adb2f1b565a5c
Reviewed-on: https://chromium-review.googlesource.com/938653
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Diffstat (limited to 'sys_util')
-rw-r--r--sys_util/src/signalfd.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys_util/src/signalfd.rs b/sys_util/src/signalfd.rs
index dc08038..62e9ba9 100644
--- a/sys_util/src/signalfd.rs
+++ b/sys_util/src/signalfd.rs
@@ -108,6 +108,12 @@ unsafe impl ::Pollable for SignalFd {
     }
 }
 
+impl AsRawFd for SignalFd {
+    fn as_raw_fd(&self) -> RawFd {
+        self.signalfd.as_raw_fd()
+    }
+}
+
 impl Drop for SignalFd {
     fn drop(&mut self) {
         // This is thread-safe and safe in the sense that we're doing what