From dc6c62af093b3184cbbe850d8ed30383ee05d01b Mon Sep 17 00:00:00 2001 From: Bo Chen Date: Fri, 14 Aug 2020 14:33:59 -0700 Subject: [PATCH] virtio-devices: Print out error message from the iommu worker thread Partially fixes: #1551 Signed-off-by: Bo Chen --- virtio-devices/src/iommu.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/virtio-devices/src/iommu.rs b/virtio-devices/src/iommu.rs index 8be20d234..a9bfd8892 100644 --- a/virtio-devices/src/iommu.rs +++ b/virtio-devices/src/iommu.rs @@ -745,7 +745,7 @@ pub struct Iommu { ext_mapping: BTreeMap>, queue_evts: Option>, interrupt_cb: Option>, - epoll_threads: Option>>>, + epoll_threads: Option>>, paused: Arc, paused_sync: Arc, } @@ -965,7 +965,11 @@ impl VirtioDevice for Iommu { let mut epoll_threads = Vec::new(); thread::Builder::new() .name("virtio_iommu".to_string()) - .spawn(move || handler.run(paused, paused_sync)) + .spawn(move || { + if let Err(e) = handler.run(paused, paused_sync) { + error!("Error running worker: {:?}", e); + } + }) .map(|thread| epoll_threads.push(thread)) .map_err(|e| { error!("failed to clone the virtio-iommu epoll thread: {}", e);