aboutsummaryrefslogtreecommitdiff
path: root/qemu-img.c
diff options
context:
space:
mode:
Diffstat (limited to 'qemu-img.c')
-rw-r--r--qemu-img.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/qemu-img.c b/qemu-img.c
index 2351686..046b267 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -2085,13 +2085,13 @@ static int img_convert(int argc, char **argv)
}
out_bs = blk_bs(out_blk);
- /* increase bufsectors from the default 4096 (2M) if opt_transfer_length
+ /* increase bufsectors from the default 4096 (2M) if opt_transfer
* or discard_alignment of the out_bs is greater. Limit to 32768 (16MB)
* as maximum. */
bufsectors = MIN(32768,
- MAX(bufsectors, MAX(out_bs->bl.opt_transfer_length,
- out_bs->bl.discard_alignment))
- );
+ MAX(bufsectors,
+ MAX(out_bs->bl.opt_transfer >> BDRV_SECTOR_BITS,
+ out_bs->bl.discard_alignment)));
if (skip_create) {
int64_t output_sectors = blk_nb_sectors(out_blk);