The OFLAG_COPIED bit (bit 63) indicates a cluster's refcount is exactly 1 and doesn't need copy-on-write. This bit must be set in L1 entries when their referenced L2 clusters have refcount=1. Previously, L1 entries were always written as raw addresses without the OFLAG_COPIED bit, violating the QCOW2 specification and causing qemu-img check to report errors like `ERROR OFLAG_COPIED L2 cluster: l1_index=X .... refcount=1` The implementation queries each L2 cluster's refcount in sync_caches() and sets OFLAG_COPIED appropriately when writing the L1 table. This ensures QCOW2 images are specification compliant and maintain correct COW semantics to avoid data corruption. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com> |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||