diff --git a/qemu-img.c b/qemu-img.c index b167376bd72e..821cbf610e5f 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -1924,8 +1924,8 @@ static void coroutine_fn convert_co_do_copy(void *opaque) 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 %lld: %s", + sector_num * BDRV_SECTOR_SIZE, strerror(-ret)); s->ret = ret; } } else if (!s->min_sparse && status == BLK_ZERO) { @@ -1953,8 +1953,8 @@ static void coroutine_fn convert_co_do_copy(void *opaque) 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 %lld: %s", + sector_num * BDRV_SECTOR_SIZE, strerror(-ret)); s->ret = ret; } } diff --git a/tests/qemu-iotests/244.out b/tests/qemu-iotests/244.out index e6f4dc79934b..56329deb4b9f 100644 --- a/tests/qemu-iotests/244.out +++ b/tests/qemu-iotests/244.out @@ -33,7 +33,7 @@ Convert to compressed target with data file: Formatting 'TEST_DIR/t.IMGFMT.src', fmt=IMGFMT size=67108864 wrote 1048576/1048576 bytes at offset 0 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -qemu-img: error while writing sector 0: Operation not supported +qemu-img: error while writing at byte 0: Operation not supported Convert uncompressed, then write compressed data manually: Images are identical.