---
Noticed while investigating https://bugzilla.redhat.com/1819240
By the way, I found it odd that even without --salvage, qemu-img
convert will process up to 8 EIO failures (based on its default
coroutine depth of 8) before finally exiting, rather than quitting
immediately on the first EIO failure.
qemu-img.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/qemu-img.c b/qemu-img.c
index b167376bd72e..77219e25b33b 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -1924,8 +1924,9 @@ retry:
if (status == BLK_DATA && !copy_range) {
ret = convert_co_read(s, sector_num, n, buf);
if (ret < 0) {
- error_report("error while reading sector %" PRId64
- ": %s", sector_num, strerror(-ret));
+ error_report("error while reading at byte %" PRId64
+ ": %s", sector_num * BDRV_SECTOR_SIZE,
+ strerror(-ret));
s->ret = ret;
}
} else if (!s->min_sparse && status == BLK_ZERO) {
@@ -1953,8 +1954,9 @@ retry:
ret = convert_co_write(s, sector_num, n, buf, status);
}
if (ret < 0) {
- error_report("error while writing sector %" PRId64
- ": %s", sector_num, strerror(-ret));
+ error_report("error while writing at byte %" PRId64
+ ": %s", sector_num * BDRV_SECTOR_SIZE,
+ strerror(-ret));
s->ret = ret;
}
}