This series makes IO requests performed with copy-on-read to be aligned to subclusters rather than clusters. It also affects mirror job requests alignment.
The initial reason for that change is the following crash discovered: qemu-img create -f qcow2 base.qcow2 64K qemu-img create -f qcow2 -o extended_l2=on,backing_file=base.qcow2,backing_fmt=qcow2 img.qcow2 64K qemu-io -c "write -P 0xaa 0 2K" img.qcow2 qemu-io -C -c "read -P 0x00 2K 62K" img.qcow2 qemu-io: ../block/io.c:1236: bdrv_co_do_copy_on_readv: Assertion `skip_bytes < pnum' failed. This change in alignment fixes the crash and adds test case covering it. Andrey Drobyshev (3): block: add subcluster_size field to BlockDriverInfo block/io: align requests to subcluster_size tests/qemu-iotests/197: add testcase for CoR with subclusters block.c | 6 +++++ block/io.c | 50 ++++++++++++++++++------------------ block/mirror.c | 8 +++--- block/qcow2.c | 1 + include/block/block-common.h | 4 +++ include/block/block-io.h | 2 +- tests/qemu-iotests/197 | 29 +++++++++++++++++++++ tests/qemu-iotests/197.out | 24 +++++++++++++++++ 8 files changed, 94 insertions(+), 30 deletions(-) -- 2.39.3