]> git.proxmox.com Git - mirror_qemu.git/commit
block: Support byte-based aio callbacks
authorEric Blake <eblake@redhat.com>
Tue, 24 Apr 2018 19:25:01 +0000 (14:25 -0500)
committerKevin Wolf <kwolf@redhat.com>
Tue, 15 May 2018 14:11:41 +0000 (16:11 +0200)
commite31f6864a6d6fa072a5d02e7679d0db6d0c22311
treefe0b54e73ca4a39f4f49884db18392a9867476dd
parent7803696d8557e02441a2781a19d4008b2f50925c
block: Support byte-based aio callbacks

We are gradually moving away from sector-based interfaces, towards
byte-based.  Add new sector-based aio callbacks for read and write,
to match the fact that bdrv_aio_pdiscard is already byte-based.

Ideally, drivers should be converted to use coroutine callbacks
rather than aio; but that is not quite as trivial (and if we were
to do that conversion, the null-aio driver would disappear), so for
the short term, converting the signature but keeping things with
aio is easier.  However, we CAN declare that a driver that uses
the byte-based aio interfaces now defaults to byte-based
operations, and must explicitly provide a refresh_limits override
to stick with larger alignments (making the alignment issues more
obvious directly in the drivers touched in the next few patches).

Once all drivers are converted, the sector-based aio callbacks will
be removed; in the meantime, a FIXME comment is added due to a
slight inefficiency that will be touched up as part of that later
cleanup.

Simplify some instances of 'bs->drv' into 'drv' while touching this,
since the local variable already exists to reduce typing.

Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/io.c
include/block/block_int.h