From cfafc85b9c95d0b621f94aee6b130e48cb5dd27a Mon Sep 17 00:00:00 2001 From: Bo Chen Date: Tue, 1 Nov 2022 13:44:25 -0700 Subject: [PATCH] virtio-devices: Custom 'EpollHelper::run_with_timeout' for fuzz To support all virtio-devices, this patch replaces the customized EpollHelper::run` with customized `EpollHelper::run_with_timeout` for fuzzing. Signed-off-by: Bo Chen --- virtio-devices/src/epoll_helper.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/virtio-devices/src/epoll_helper.rs b/virtio-devices/src/epoll_helper.rs index 83965c9e9..7be1f6407 100644 --- a/virtio-devices/src/epoll_helper.rs +++ b/virtio-devices/src/epoll_helper.rs @@ -148,7 +148,6 @@ impl EpollHelper { .map_err(EpollHelperError::Ctl) } - #[cfg(not(fuzzing))] pub fn run( &mut self, paused: Arc, @@ -158,6 +157,7 @@ impl EpollHelper { self.run_with_timeout(paused, paused_sync, handler, -1, false) } + #[cfg(not(fuzzing))] pub fn run_with_timeout( &mut self, paused: Arc, @@ -245,11 +245,13 @@ impl EpollHelper { #[cfg(fuzzing)] // Require to have a 'queue_evt' being kicked before calling // and return when no epoll events are active - pub fn run( + pub fn run_with_timeout( &mut self, paused: Arc, paused_sync: Arc, handler: &mut dyn EpollHelperHandler, + _timeout: i32, + _enable_event_list: bool, ) -> std::result::Result<(), EpollHelperError> { const EPOLL_EVENTS_LEN: usize = 100; let mut events = vec![epoll::Event::new(epoll::Events::empty(), 0); EPOLL_EVENTS_LEN];