From e9c4383764c5657f3389c68c8039d39e5a519d54 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Fri, 19 Apr 2019 14:01:12 -0700 Subject: [PATCH] devices: block: clarify read/write error messages Fix up the Display impl for ExecuteError so that it's clear which direction data is moving for the Read and Write variants. BUG=None TEST=cargo build Change-Id: Ide4ea5cb453e4d7f6bd2812a1696df96daec511b Signed-off-by: Daniel Verkamp Reviewed-on: https://chromium-review.googlesource.com/1574963 Commit-Ready: ChromeOS CL Exonerator Bot Tested-by: kokoro Reviewed-by: Zach Reizner --- devices/src/virtio/block.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/devices/src/virtio/block.rs b/devices/src/virtio/block.rs index e5b6c33ea5..ef9b145df2 100644 --- a/devices/src/virtio/block.rs +++ b/devices/src/virtio/block.rs @@ -258,8 +258,8 @@ impl Display for ExecuteError { guestmemerr, } => write!( f, - "failed to read {} bytes from address {} sector {}: {}", - length, addr, sector, guestmemerr, + "failed to read {} bytes from sector {} to address {}: {}", + length, sector, addr, guestmemerr, ), Seek { ioerr, sector } => write!(f, "failed to seek to sector {}: {}", sector, ioerr), TimerFd(e) => write!(f, "{}", e), @@ -270,7 +270,7 @@ impl Display for ExecuteError { guestmemerr, } => write!( f, - "failed to write {} bytes to address {} sector {}: {}", + "failed to write {} bytes from address {} to sector {}: {}", length, addr, sector, guestmemerr, ), DiscardWriteZeroes {