Revert "vhost-user-backend: Correct error handling in run"

This reverts commit 4a1af7f63c.

This change erroneously ignored the return value for the result which
meant that requests to break out of the loop due to a kill event were
lost.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2020-02-06 10:47:43 +00:00 committed by Sebastien Boeuf
parent c706ca1522
commit 80c9dc2e0c

View File

@ -262,6 +262,8 @@ impl<S: VhostUserBackend> VringEpollHandler<S> {
enum VringWorkerError {
/// Failed while waiting for events.
EpollWait(io::Error),
/// Failed to handle the event.
HandleEvent(VringEpollHandlerError),
}
/// Result of vring worker operations.
@ -306,11 +308,10 @@ impl VringWorker {
let ev_type = event.data as u16;
if let Err(e) = handler.handle_event(ev_type, evset) {
println!(
"vring handler handle event {} with error {:?}\n",
ev_type, e
);
if handler
.handle_event(ev_type, evset)
.map_err(VringWorkerError::HandleEvent)?
{
break 'epoll;
}
}