cloud-hypervisor/block
Anatol Belski 9bc367a27b block: qcow: Use Arc<Mutex<>> for thread safe multiqueue access
Wrap QcowFile in Arc<Mutex<>> to ensure thread safety when multiple
virtio queues access the same QCOW2 image concurrently.

Previously, each queue received its own QcowSync instance via
new_async_io() that shared the underlying QcowFile through Clone.
However, cloned QcowFile instances share internal mutable state
(L2 cache, reference counts, file seek position) without
synchronization, leading to data corruption under concurrent I/O.

This change serializes all QCOW2 operations through a mutex, which
ensures correctness at the cost of parallelism. A more performant
solution would require separating metadata locking from actual I/O
operations, tracked in #7560.

Related: #7560

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-03 22:43:38 +00:00
..
src block: qcow: Use Arc<Mutex<>> for thread safe multiqueue access 2026-02-03 22:43:38 +00:00
Cargo.toml block: qcow: Validate incompatible feature bits 2026-01-23 18:58:56 +00:00