From 4ebf01b344e0b911987fa61a4388fcc17525964a Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Wed, 19 Feb 2020 14:22:30 +0000 Subject: [PATCH] vhost_user_backend: Don't report out socket broken errors This is a perfectly acceptable situation as it causes the backend to exit because the VMM has closed the connection. This addresses the rather ugly reporting of errors from the backend that appears interleaved with the output from the VMM. Signed-off-by: Rob Bradford --- vhost_user_backend/src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vhost_user_backend/src/lib.rs b/vhost_user_backend/src/lib.rs index 0e94da572..6256e066f 100644 --- a/vhost_user_backend/src/lib.rs +++ b/vhost_user_backend/src/lib.rs @@ -174,7 +174,11 @@ impl VhostUserDaemon { /// terminate. pub fn wait(&mut self) -> Result<()> { if let Some(handle) = self.main_thread.take() { - handle.join().map_err(Error::WaitDaemon)? + match handle.join().map_err(Error::WaitDaemon)? { + Ok(()) => Ok(()), + Err(Error::HandleRequest(VhostUserError::SocketBroken(_))) => Ok(()), + Err(e) => Err(e), + } } else { Ok(()) }