mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
The raw sync, io_uring and AIO workers now own an AlignedFile and use it for the O_DIRECT alignment value and for the unaligned fallback. Aligned operations keep the fast preadv and pwritev iovec path straight to the kernel. When the offset or an iovec base or length is not a multiple of the probed alignment, the worker gathers the iovecs into one contiguous host buffer and runs a synchronous RMW through AlignedFile, then scatters the result back into guest memory. RawDisk constructs the AlignedFile from the disk file and the direct flag and passes it into each worker, so alignment is probed once at open time. The fixed VHD workers are threaded through the same AlignedFile based constructors using a non-direct AlignedFile to preserve current behavior. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>