mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-04-01 20:04:37 +00:00
vhost-user-backend: Correct error handling in run
The error handling here to trigger break epoll seems not correct, epoll will be ended once one event is handled, no matter successfully or failed. Fix it. Signed-off-by: Cathy Zhang <cathy.zhang@intel.com>
This commit is contained in:
parent
c4309515c9
commit
4a1af7f63c
@ -40,8 +40,6 @@ pub enum Error {
|
||||
WaitDaemon(std::boxed::Box<dyn std::any::Any + std::marker::Send>),
|
||||
/// Failed handling a vhost-user request.
|
||||
HandleRequest(VhostUserError),
|
||||
/// Failed to handle the event.
|
||||
HandleEvent(io::Error),
|
||||
/// Failed to process queue.
|
||||
ProcessQueue(VringEpollHandlerError),
|
||||
/// Failed to register listener.
|
||||
@ -439,13 +437,11 @@ impl<S: VhostUserBackend> VringWorker<S> {
|
||||
|
||||
let ev_type = event.data as u16;
|
||||
|
||||
if self
|
||||
.handler
|
||||
.write()
|
||||
.unwrap()
|
||||
.handle_event(ev_type, evset)
|
||||
.map_err(VringWorkerError::HandleEvent)?
|
||||
{
|
||||
if let Err(e) = self.handler.write().unwrap().handle_event(ev_type, evset) {
|
||||
println!(
|
||||
"vring handler handle event {} with error {:?}\n",
|
||||
ev_type, e
|
||||
);
|
||||
break 'epoll;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user