mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
Thread the direct flag from the disk open options through VhdDisk into the AlignedFile the workers run on, so a fixed VHD opened with direct=on issues O_DIRECT I/O instead of buffered I/O. Alignment is probed once on that AlignedFile and reused by the sync and io_uring workers. Advertise host topology from VhdDisk::topology by probing the underlying file. On a 4096 byte sector filesystem opened with O_DIRECT this reports logical_block_size 4096 to the guest, so the guest never issues 512 byte I/O that the host kernel would reject as misaligned. Falls back to the default topology with a warning when the probe fails. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>