Copy-on-read
Copy-on-read is a virtual-disk mode that copies inherited data into an overlay's storage when that data is read.
QEMU and libvirt expose copy-on-read as an optional mode, disabled by default. It avoids repeated backing reads; a speedup is workload-dependent. [1] [2]
A workload containing only guest reads differs from a read-only block node: QEMU v8.2.2 rejects its copy-on-read opening flag on such a node. Read-triggered materialization changes storage without a guest write. [3] [4]
In eight offline configurations run twice, a 512-byte read localized 65,536 bytes with standard 64-KiB clusters, or 4,096 with extended L2 and 128-KiB clusters. Ordinary reads left the data inherited. These are logical map lengths, not physical write or allocation counts. Zero input used zero mappings; complete exports and bases stayed unchanged. The backing filename and unread dependencies remained. [6]
Tang's 2011 FVD paper distinguishes read-triggered copying from prefetching untouched regions. Its PostMark comparison disabled both features: its reported advantage is not a copy-on-read speedup. [7]
The separate QEMU copy-on-read filter can limit copying to an inclusive bottom allocation-bearing node. Deeper data can remain inherited. Neither enabling the mode nor a successful partial read proves a self-contained, authentic recovery image. Preserve remaining backing dependencies. [8] [4]
FVD's section 3.2 permits copied data to remain absent from the durable bitmap: after a host crash, the unchanged base can supply the same contents again. This is a source-retention argument for that design, not a QCOW2 persistence guarantee or evidence that the base can be removed. [7]
Relations
Citations
- QEMU v8.2.2: copy-on-read drive option and default
- libvirt domain XML: disk driver copy_on_read attribute
- QEMU v8.2.2 block.c: copy-on-read opening checks
- QEMU v8.2.2 block/io.c: bdrv_co_do_copy_on_readv
- Hesela: eight offline QEMU read-materialization configurations, command receipts and full-content hashes
- Chunqiang Tang (2011), FVD, USENIX ATC 11, sections 3 and 4
- QEMU v8.2.2 QAPI: BlockdevOptionsCor and optional bottom boundary
Further reading
Sources & caveats
- QEMU v8.2.2/libvirt and USENIX ATC 2011 source review. Eight synthetic offline configurations run twice on Ubuntu qemu-utils 1:8.2.2+ds-0ubuntu1.18; no VM, crash, performance or application-recovery experiment.
- Executable hashes, command receipts, maps, full-content hashes and reproduction code are published with the existing QCOW2 analysis.