diff --git a/vhost_user_backend/src/lib.rs b/vhost_user_backend/src/lib.rs index 883ca811a..c43c5ea1b 100644 --- a/vhost_user_backend/src/lib.rs +++ b/vhost_user_backend/src/lib.rs @@ -329,6 +329,12 @@ impl VringEpollHandler { .map_err(VringEpollHandlerError::HandleEventReadKick)?; } + // If the vring is not enabled, it should not be processed. + // The event is only read to be discarded. + if !self.vrings[device_event as usize].read().unwrap().enabled { + return Ok(false); + } + self.process_queue(device_event)?; Ok(false) }