mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-08-21 23:41:15 +00:00
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:
parent
80c9dc2e0c
commit
f1e19d6c96
@ -153,10 +153,11 @@ impl<S: VhostUserBackend> VhostUserDaemon<S> {
|
|||||||
/// terminate.
|
/// terminate.
|
||||||
pub fn wait(&mut self) -> Result<()> {
|
pub fn wait(&mut self) -> Result<()> {
|
||||||
if let Some(handle) = self.main_thread.take() {
|
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
|
/// Retrieve the vring worker. This is necessary to perform further
|
||||||
/// actions like registering and unregistering some extra event file
|
/// actions like registering and unregistering some extra event file
|
||||||
|
Loading…
Reference in New Issue
Block a user