devices: virtio: iommu: fix spurious warning

Skip logging an error when the translate request tube closes. That
happens whenever the process on the other side of the tube closes, and
isn't an error in and of itself.

BUG=None
TEST=exit crosvm and observe no virtio-iommu error message

Change-Id: I5f0460182a96d00f8c348224c838554710fc5451
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3659815
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>
This commit is contained in:
David Stevens 2022-05-23 14:17:30 +09:00 committed by Chromeos LUCI
parent 6e13a86d25
commit ecb376c7b2

View file

@ -667,7 +667,7 @@ fn run(
};
match ex.run_until(done) {
Ok(Ok(())) => {}
Ok(Err(e)) => error!("Error in worker: {}", e),
Ok(Err(e)) => error!("Error in worker: {:#}", e),
Err(e) => return Err(IommuError::AsyncExec(e)),
}
@ -692,7 +692,18 @@ async fn handle_translate_request(
endpoint_id,
iova,
size,
} = request_tube.next().await.map_err(IommuError::Tube)?;
} = match request_tube.next().await {
Ok(req) => req,
Err(TubeError::Disconnected) => {
// This means the process on the other side of the tube went away. That's
// not a problem with virtio-iommu itself, so just exit this callback
// and wait for crosvm to exit.
return Ok(());
}
Err(e) => {
return Err(IommuError::Tube(e));
}
};
let translate_response: Option<Vec<MemRegion>> =
if let Some(mapper) = state.borrow_mut().endpoints.get(&endpoint_id) {
mapper