mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
Replace the seek then read/write metadata access in QcowRawFile with positional read_exact_at, write_all_at, and write_all_zeroes_at on the AlignedFile. read_pointer_table, write_pointer_table, write_pointer_table_direct, zero_cluster, and write_cluster no longer move the file cursor. These calls still route through AlignedFile, which implements FileExt and WriteZeroesAt with the O_DIRECT alignment bounce, so the unaligned behavior is preserved. Each access already issued an absolute seek before touching the file, so the cursor never carried state between calls and dropping it is unobservable. Decoding the pointer table now uses native from_be_bytes over the read buffer, matching the to_be_bytes path on the write side. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>