fuzz: Don't overload meaning of reset()

This function is for really for the transport layer to trigger a device
reset. Instead name it appropriately for the fuzzing specific use case.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2022-09-22 09:13:15 +01:00
committed by Bo Chen
parent c98bd2fd4a
commit 194b59f44b
12 changed files with 37 additions and 10 deletions

View File

@@ -258,7 +258,6 @@ impl VirtioCommon {
Ok(())
}
#[cfg(not(fuzzing))]
pub fn reset(&mut self) -> Option<Arc<dyn VirtioInterrupt>> {
// We first must resume the virtio thread if it was paused.
if self.pause_evt.take().is_some() {
@@ -282,9 +281,9 @@ impl VirtioCommon {
Some(self.interrupt_cb.take().unwrap())
}
#[cfg(fuzzing)]
// Wait for the worker thread to finish and return
pub fn reset(&mut self) -> Option<Arc<dyn VirtioInterrupt>> {
#[cfg(fuzzing)]
pub fn wait_for_epoll_threads(&mut self) {
if let Some(mut threads) = self.epoll_threads.take() {
for t in threads.drain(..) {
if let Err(e) = t.join() {
@@ -292,8 +291,6 @@ impl VirtioCommon {
}
}
}
None
}
pub fn dup_eventfds(&self) -> (EventFd, EventFd) {