block: qcow: Add missing flush in write_refcount_block

The BufWriter must be flushed explicitly to handle errors
properly. Without explicit flush, errors during the implicit
drop flush are ignored.

This is the same issue fixed for write_pointer_table
in commit 85556951a.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
Anatol Belski 2025-12-08 20:01:32 +01:00 committed by Rob Bradford
parent f0dfa2a5ef
commit 562af123d5

View file

@ -102,6 +102,7 @@ impl QcowRawFile {
for count in table {
buffer.write_u16::<BigEndian>(*count)?;
}
buffer.flush()?;
Ok(())
}