block: qcow_async: impl fsync for QcowAsync

Flush dirty metadata caches and sync the underlying file via
QcowMetadata::flush, then signal synthetic completion.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
Anatol Belski
2026-03-20 20:07:32 +01:00
committed by Rob Bradford
parent a97260c5e0
commit bf70c19857

View File

@@ -248,7 +248,12 @@ impl AsyncIo for QcowAsync {
}
fn fsync(&mut self, user_data: Option<u64>) -> AsyncIoResult<()> {
unimplemented!()
self.metadata.flush().map_err(AsyncIoError::Fsync)?;
if let Some(user_data) = user_data {
self.completion_list.push_back((user_data, 0));
self.eventfd.write(1).unwrap();
}
Ok(())
}
fn next_completed_request(&mut self) -> Option<(u64, i32)> {