vhost_user_backend: Forward the error from main thread

The main thread returns a Result with any errors from it. Although the
error from the join itself was being returned the real error from the
thread was being ignored so ensure that it is forwarded.

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

View File

@ -153,9 +153,10 @@ impl<S: VhostUserBackend> VhostUserDaemon<S> {
/// terminate.
pub fn wait(&mut self) -> Result<()> {
if let Some(handle) = self.main_thread.take() {
let _ = handle.join().map_err(Error::WaitDaemon)?;
handle.join().map_err(Error::WaitDaemon)?
} else {
Ok(())
}
Ok(())
}
/// Retrieve the vring worker. This is necessary to perform further