mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vhost_user_backend: Don't process disabled queues
Every time an event is triggered, it needs to be read, but only based on the status of the vring (enabled or not) will decide if the queue needs to be processed. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
@@ -329,6 +329,12 @@ impl<S: VhostUserBackend> VringEpollHandler<S> {
|
||||
.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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user