qemu-e2k/include
Andrey Drobyshev fc6b211f92 block/io: align requests to subcluster_size
When target image is using subclusters, and we align the request during
copy-on-read, it makes sense to align to subcluster_size rather than
cluster_size.  Otherwise we end up with unnecessary allocations.

This commit renames bdrv_round_to_clusters() to bdrv_round_to_subclusters()
and utilizes subcluster_size field of BlockDriverInfo to make necessary
alignments.  It affects copy-on-read as well as mirror job (which is
using bdrv_round_to_clusters()).

This change also fixes the following bug with failing assert (covered by
the test in the subsequent commit):

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.

Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20230711172553.234055-3-andrey.drobyshev@virtuozzo.com>
2023-08-30 07:39:10 -04:00
..
authz
block block/io: align requests to subcluster_size 2023-08-30 07:39:10 -04:00
chardev
crypto crypto: Unexport AES_*_rot, AES_TeN, AES_TdN 2023-07-09 13:48:23 +01:00
disas
exec include/exec: Widen tlb_hit/tlb_hit_page() 2023-08-24 11:22:23 -07:00
fpu fpu: Add float64_to_int{32,64}_modulo 2023-07-01 08:26:54 +02:00
gdbstub
hw target-arm queue: 2023-08-24 10:08:33 -04:00
io io: remove io watch if TLS channel is closed during handshake 2023-08-01 18:45:27 +01:00
libdecnumber
migration migration/ram: Expose ramblock_is_ignored() as migrate_ram_is_ignored() 2023-07-12 09:25:37 +02:00
monitor
net
qapi
qemu bsd-user: Disable clang warnings 2023-08-28 12:16:18 -06:00
qom
scsi
semihosting
standard-headers linux-headers: update to v6.5-rc1 2023-07-10 09:52:52 +02:00
sysemu sysemu/hvf: Use vaddr for hvf_arch_[insert|remove]_hw_breakpoint 2023-08-24 11:21:40 -07:00
tcg tcg: Introduce negsetcond opcodes 2023-08-24 11:22:42 -07:00
ui virtio-gpu-udmabuf: correct naming of QemuDmaBuf size properties 2023-07-17 15:22:28 +04:00
user
elf.h linux-user/elfload: Fix /proc/cpuinfo features: on s390x 2023-07-18 09:36:27 +02:00
glib-compat.h
qemu-io.h
qemu-main.h