vmm: Fix map_err losing the inner error

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2020-01-24 09:34:51 +01:00
parent 0a7bcc9a7d
commit 148a9ed5ce
3 changed files with 25 additions and 17 deletions

View File

@@ -109,7 +109,7 @@ pub enum Error {
VcpuUnhandledKvmExit,
/// Failed to join on vCPU threads
ThreadCleanup,
ThreadCleanup(std::boxed::Box<dyn std::any::Any + std::marker::Send>),
/// Cannot add legacy device to Bus.
BusError(devices::BusError),
@@ -478,7 +478,7 @@ impl VcpuState {
fn join_thread(&mut self) -> Result<()> {
if let Some(handle) = self.handle.take() {
handle.join().map_err(|_| Error::ThreadCleanup)?
handle.join().map_err(Error::ThreadCleanup)?
}
Ok(())