From 6c1da4f5c1172edf21ea349167189ef7049d5723 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 13 Apr 2026 19:50:15 +0200 Subject: [PATCH] block: qcow: Expose RawFile alignment as a public accessor Add pub fn alignment() to RawFile so that callers can query the O_DIRECT buffer alignment requirement probed at file open time. Signed-off-by: Anatol Belski --- block/src/qcow/raw_file.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/block/src/qcow/raw_file.rs b/block/src/qcow/raw_file.rs index 56ec79735..c2a01811f 100644 --- a/block/src/qcow/raw_file.rs +++ b/block/src/qcow/raw_file.rs @@ -125,6 +125,10 @@ impl RawFile { self.direct_io } + pub fn alignment(&self) -> usize { + self.alignment + } + /// Returns true if the file was opened with write access. pub fn is_writable(&self) -> bool { // SAFETY: fcntl with F_GETFL is safe and doesn't modify the file descriptor