Skip to content

Commit 946df96

Browse files
committed
[otlib,qemu,usb] Ignore errors coming from shutting down the host thread
Signed-off-by: Amaury Pouly <[email protected]>
1 parent 2a5bfd5 commit 946df96

File tree

1 file changed

+6
-1
lines changed
  • sw/host/opentitanlib/src/transport/qemu

1 file changed

+6
-1
lines changed

sw/host/opentitanlib/src/transport/qemu/usbdev.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,12 @@ impl QemuHostThread {
899899
if let Err(res) =
900900
Self::host_qemu_reader_thread(usbdev_for_reader, channel_send_for_reader)
901901
{
902-
log::error!("QEMU reader failed with error: {res:?}");
902+
// Ignore errors coming for the mpsc channel because they indicate that
903+
// the host thread shut down and the reader couldn't send a message.
904+
match res.downcast::<mpsc::SendError<HostChannelEvent>>() {
905+
Ok(_) => (),
906+
Err(err) => log::error!("QEMU reader failed with error: {err:?}"),
907+
}
903908
}
904909
});
905910

0 commit comments

Comments
 (0)