{
  "slug": "copy-on-read",
  "term": "Copy-on-read",
  "aliases": [],
  "definition": "Copy-on-read is a virtual-disk mode that copies inherited data into an overlay's storage when that data is read.",
  "note": "QEMU and libvirt expose copy-on-read as an optional mode, disabled by default. It avoids repeated backing reads; a speedup is workload-dependent. [qemu-copy-options] [libvirt-copy-on-read]\n\nA 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. [qemu-copy-open] [qemu-copy-io]\n\nIn 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. [hesela-copy-native]\n\nTang'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. [tang-fvd]\n\nThe 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. [qemu-copy-filter] [qemu-copy-io]\n\nFVD'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. [tang-fvd]",
  "status": "shipping",
  "advantages": [],
  "limitations": [],
  "related": [
    "qcow2",
    "qcow2-backing-chain",
    "copy-on-write"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-05",
  "citations": [
    {
      "id": "qemu-copy-options",
      "title": "QEMU v8.2.2: copy-on-read drive option and default",
      "url": "https://github.com/qemu/qemu/blob/v8.2.2/qemu-options.hx",
      "accessed": "2026-11-05"
    },
    {
      "id": "libvirt-copy-on-read",
      "title": "libvirt domain XML: disk driver copy_on_read attribute",
      "url": "https://libvirt.org/formatdomain.html#hard-drives-floppy-disks-cdroms",
      "accessed": "2026-11-05"
    },
    {
      "id": "qemu-copy-open",
      "title": "QEMU v8.2.2 block.c: copy-on-read opening checks",
      "url": "https://github.com/qemu/qemu/blob/v8.2.2/block.c",
      "accessed": "2026-11-05"
    },
    {
      "id": "qemu-copy-io",
      "title": "QEMU v8.2.2 block/io.c: bdrv_co_do_copy_on_readv",
      "url": "https://github.com/qemu/qemu/blob/v8.2.2/block/io.c",
      "accessed": "2026-11-05"
    },
    {
      "id": "hesela-qcow2-copy",
      "title": "Hesela: QCOW2 backups and read-triggered materialization",
      "url": "https://hesela.com/analyses/qcow2-backing-chain-verification/#copy-on-read",
      "accessed": "2026-11-05"
    },
    {
      "id": "hesela-copy-native",
      "title": "Hesela: eight offline QEMU read-materialization configurations, command receipts and full-content hashes",
      "url": "https://hesela.dev/research/copy-on-read/observations.json",
      "accessed": "2026-11-05"
    },
    {
      "id": "tang-fvd",
      "title": "Chunqiang Tang (2011), FVD, USENIX ATC 11, sections 3 and 4",
      "url": "https://www.usenix.org/legacy/event/atc11/tech/final_files/Tang.pdf",
      "accessed": "2026-11-05"
    },
    {
      "id": "qemu-copy-filter",
      "title": "QEMU v8.2.2 QAPI: BlockdevOptionsCor and optional bottom boundary",
      "url": "https://github.com/qemu/qemu/blob/v8.2.2/qapi/block-core.json",
      "accessed": "2026-11-05"
    }
  ],
  "provenance": [
    "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."
  ]
}
