{
  "schemaVersion": 1,
  "slug": "qcow2-dependency-observations",
  "title": "QCOW2 dependency and verification observations",
  "summary": "Ten controlled cases separate overlay identity, backing dependencies, image consistency and guest-byte comparison.",
  "published": "2026-10-18",
  "updated": "2026-10-18",
  "generatedAt": "2026-10-18T20:08:09.979218+00:00",
  "evidenceType": "measured-tool-behavior-with-synthetic-inputs",
  "license": "CC0-1.0 for original Hesela code and observations; QEMU and upstream documentation retain their own licenses.",
  "licenseUrl": "https://creativecommons.org/publicdomain/zero/1.0/",
  "humanPage": "https://hesela.com/analyses/qcow2-backing-chain-verification/",
  "sourceUrl": "https://hesela.com/analyses/qcow2-backing-chain-verification/",
  "downloadPath": "/data/datasets/qcow2-dependency-observations.csv",
  "rawPath": "/research/qcow2-dependencies.json",
  "codePath": "/research/qcow2-dependencies.py",
  "generatorPath": "/research/build-qcow2.py",
  "rowCount": 30,
  "columns": [
    {
      "name": "repetition",
      "type": "integer",
      "description": "Repeat number on one host, not an independent reliability trial."
    },
    {
      "name": "case",
      "type": "string",
      "description": "Controlled fixture manipulation."
    },
    {
      "name": "checkExit",
      "type": "integer|null",
      "description": "qemu-img check status: 0 completed consistently; 1 could not open the missing dependency. Null for raw size control."
    },
    {
      "name": "compareExit",
      "type": "integer",
      "description": "qemu-img compare: 0 equal under default rules; 1 differs; 2 opening error."
    },
    {
      "name": "exportExit",
      "type": "integer|null",
      "description": "Full raw export: 0 success; 1 opening failure; null for size control."
    },
    {
      "name": "topHashUnchanged",
      "type": "boolean|null",
      "description": "Overlay SHA-256 equals its own pre-manipulation hash; null for size control."
    },
    {
      "name": "guestMatchesBaseline",
      "type": "boolean|null",
      "description": "Every exported byte equals the independent baseline; null when unreadable or not applicable."
    },
    {
      "name": "changedGuestBytes",
      "type": "integer|null",
      "description": "Differing byte positions against the equal-length baseline; null when unavailable."
    },
    {
      "name": "strictCompareExit",
      "type": "integer|null",
      "description": "Strict compare status in the zero-tail control; null elsewhere."
    }
  ],
  "rows": [
    {
      "repetition": 1,
      "case": "intact",
      "checkExit": 0,
      "compareExit": 0,
      "exportExit": 0,
      "topHashUnchanged": true,
      "guestMatchesBaseline": true,
      "changedGuestBytes": 0,
      "strictCompareExit": null
    },
    {
      "repetition": 1,
      "case": "base-replaced",
      "checkExit": 0,
      "compareExit": 1,
      "exportExit": 0,
      "topHashUnchanged": true,
      "guestMatchesBaseline": false,
      "changedGuestBytes": 131072,
      "strictCompareExit": null
    },
    {
      "repetition": 1,
      "case": "base-missing",
      "checkExit": 1,
      "compareExit": 2,
      "exportExit": 1,
      "topHashUnchanged": true,
      "guestMatchesBaseline": null,
      "changedGuestBytes": null,
      "strictCompareExit": null
    },
    {
      "repetition": 1,
      "case": "overlay-only-relocated",
      "checkExit": 1,
      "compareExit": 2,
      "exportExit": 1,
      "topHashUnchanged": true,
      "guestMatchesBaseline": null,
      "changedGuestBytes": null,
      "strictCompareExit": null
    },
    {
      "repetition": 1,
      "case": "chain-relocated",
      "checkExit": 0,
      "compareExit": 0,
      "exportExit": 0,
      "topHashUnchanged": true,
      "guestMatchesBaseline": true,
      "changedGuestBytes": 0,
      "strictCompareExit": null
    },
    {
      "repetition": 1,
      "case": "payload-byte-flip",
      "checkExit": 0,
      "compareExit": 1,
      "exportExit": 0,
      "topHashUnchanged": false,
      "guestMatchesBaseline": false,
      "changedGuestBytes": 1,
      "strictCompareExit": null
    },
    {
      "repetition": 1,
      "case": "safe-rebase",
      "checkExit": 0,
      "compareExit": 0,
      "exportExit": 0,
      "topHashUnchanged": false,
      "guestMatchesBaseline": true,
      "changedGuestBytes": 0,
      "strictCompareExit": null
    },
    {
      "repetition": 1,
      "case": "unsafe-rebase",
      "checkExit": 0,
      "compareExit": 1,
      "exportExit": 0,
      "topHashUnchanged": false,
      "guestMatchesBaseline": false,
      "changedGuestBytes": 131072,
      "strictCompareExit": null
    },
    {
      "repetition": 1,
      "case": "base-truncated",
      "checkExit": 0,
      "compareExit": 1,
      "exportExit": 0,
      "topHashUnchanged": true,
      "guestMatchesBaseline": false,
      "changedGuestBytes": 131072,
      "strictCompareExit": null
    },
    {
      "repetition": 1,
      "case": "zero-tail-size",
      "checkExit": null,
      "compareExit": 0,
      "exportExit": null,
      "topHashUnchanged": null,
      "guestMatchesBaseline": null,
      "changedGuestBytes": null,
      "strictCompareExit": 1
    },
    {
      "repetition": 2,
      "case": "intact",
      "checkExit": 0,
      "compareExit": 0,
      "exportExit": 0,
      "topHashUnchanged": true,
      "guestMatchesBaseline": true,
      "changedGuestBytes": 0,
      "strictCompareExit": null
    },
    {
      "repetition": 2,
      "case": "base-replaced",
      "checkExit": 0,
      "compareExit": 1,
      "exportExit": 0,
      "topHashUnchanged": true,
      "guestMatchesBaseline": false,
      "changedGuestBytes": 131072,
      "strictCompareExit": null
    },
    {
      "repetition": 2,
      "case": "base-missing",
      "checkExit": 1,
      "compareExit": 2,
      "exportExit": 1,
      "topHashUnchanged": true,
      "guestMatchesBaseline": null,
      "changedGuestBytes": null,
      "strictCompareExit": null
    },
    {
      "repetition": 2,
      "case": "overlay-only-relocated",
      "checkExit": 1,
      "compareExit": 2,
      "exportExit": 1,
      "topHashUnchanged": true,
      "guestMatchesBaseline": null,
      "changedGuestBytes": null,
      "strictCompareExit": null
    },
    {
      "repetition": 2,
      "case": "chain-relocated",
      "checkExit": 0,
      "compareExit": 0,
      "exportExit": 0,
      "topHashUnchanged": true,
      "guestMatchesBaseline": true,
      "changedGuestBytes": 0,
      "strictCompareExit": null
    },
    {
      "repetition": 2,
      "case": "payload-byte-flip",
      "checkExit": 0,
      "compareExit": 1,
      "exportExit": 0,
      "topHashUnchanged": false,
      "guestMatchesBaseline": false,
      "changedGuestBytes": 1,
      "strictCompareExit": null
    },
    {
      "repetition": 2,
      "case": "safe-rebase",
      "checkExit": 0,
      "compareExit": 0,
      "exportExit": 0,
      "topHashUnchanged": false,
      "guestMatchesBaseline": true,
      "changedGuestBytes": 0,
      "strictCompareExit": null
    },
    {
      "repetition": 2,
      "case": "unsafe-rebase",
      "checkExit": 0,
      "compareExit": 1,
      "exportExit": 0,
      "topHashUnchanged": false,
      "guestMatchesBaseline": false,
      "changedGuestBytes": 131072,
      "strictCompareExit": null
    },
    {
      "repetition": 2,
      "case": "base-truncated",
      "checkExit": 0,
      "compareExit": 1,
      "exportExit": 0,
      "topHashUnchanged": true,
      "guestMatchesBaseline": false,
      "changedGuestBytes": 131072,
      "strictCompareExit": null
    },
    {
      "repetition": 2,
      "case": "zero-tail-size",
      "checkExit": null,
      "compareExit": 0,
      "exportExit": null,
      "topHashUnchanged": null,
      "guestMatchesBaseline": null,
      "changedGuestBytes": null,
      "strictCompareExit": 1
    },
    {
      "repetition": 3,
      "case": "intact",
      "checkExit": 0,
      "compareExit": 0,
      "exportExit": 0,
      "topHashUnchanged": true,
      "guestMatchesBaseline": true,
      "changedGuestBytes": 0,
      "strictCompareExit": null
    },
    {
      "repetition": 3,
      "case": "base-replaced",
      "checkExit": 0,
      "compareExit": 1,
      "exportExit": 0,
      "topHashUnchanged": true,
      "guestMatchesBaseline": false,
      "changedGuestBytes": 131072,
      "strictCompareExit": null
    },
    {
      "repetition": 3,
      "case": "base-missing",
      "checkExit": 1,
      "compareExit": 2,
      "exportExit": 1,
      "topHashUnchanged": true,
      "guestMatchesBaseline": null,
      "changedGuestBytes": null,
      "strictCompareExit": null
    },
    {
      "repetition": 3,
      "case": "overlay-only-relocated",
      "checkExit": 1,
      "compareExit": 2,
      "exportExit": 1,
      "topHashUnchanged": true,
      "guestMatchesBaseline": null,
      "changedGuestBytes": null,
      "strictCompareExit": null
    },
    {
      "repetition": 3,
      "case": "chain-relocated",
      "checkExit": 0,
      "compareExit": 0,
      "exportExit": 0,
      "topHashUnchanged": true,
      "guestMatchesBaseline": true,
      "changedGuestBytes": 0,
      "strictCompareExit": null
    },
    {
      "repetition": 3,
      "case": "payload-byte-flip",
      "checkExit": 0,
      "compareExit": 1,
      "exportExit": 0,
      "topHashUnchanged": false,
      "guestMatchesBaseline": false,
      "changedGuestBytes": 1,
      "strictCompareExit": null
    },
    {
      "repetition": 3,
      "case": "safe-rebase",
      "checkExit": 0,
      "compareExit": 0,
      "exportExit": 0,
      "topHashUnchanged": false,
      "guestMatchesBaseline": true,
      "changedGuestBytes": 0,
      "strictCompareExit": null
    },
    {
      "repetition": 3,
      "case": "unsafe-rebase",
      "checkExit": 0,
      "compareExit": 1,
      "exportExit": 0,
      "topHashUnchanged": false,
      "guestMatchesBaseline": false,
      "changedGuestBytes": 131072,
      "strictCompareExit": null
    },
    {
      "repetition": 3,
      "case": "base-truncated",
      "checkExit": 0,
      "compareExit": 1,
      "exportExit": 0,
      "topHashUnchanged": true,
      "guestMatchesBaseline": false,
      "changedGuestBytes": 131072,
      "strictCompareExit": null
    },
    {
      "repetition": 3,
      "case": "zero-tail-size",
      "checkExit": null,
      "compareExit": 0,
      "exportExit": null,
      "topHashUnchanged": null,
      "guestMatchesBaseline": null,
      "changedGuestBytes": null,
      "strictCompareExit": 1
    }
  ],
  "environment": {
    "python": "3.12.3",
    "kernel": "6.8.0-146-generic",
    "qemuImg": {
      "version": "qemu-img version 8.2.2 (Debian 1:8.2.2+ds-0ubuntu1.18)",
      "binarySha256": "634320b91165669917123e8e79cce1c4d00cee0a4aa4d662d7c0a8186479b3fb"
    },
    "qemuIo": {
      "version": "qemu-io version 8.2.2 (Debian 1:8.2.2+ds-0ubuntu1.18)",
      "binarySha256": "71b3d50189aae57b2d01a5f16c46c1c48d006bf27403b7033478b9a6f013d414"
    }
  },
  "citations": [
    {
      "id": "qemu-tool",
      "title": "QEMU 8.2.2: qemu-img check, compare and rebase",
      "url": "https://github.com/qemu/qemu/blob/v8.2.2/docs/tools/qemu-img.rst",
      "accessed": "2026-10-18"
    },
    {
      "id": "qcow2-format",
      "title": "QEMU 8.2.2: QCOW2 image file format, cluster mapping and zero clusters",
      "url": "https://github.com/qemu/qemu/blob/v8.2.2/docs/interop/qcow2.txt",
      "accessed": "2026-10-18"
    },
    {
      "id": "qemu-refcounts",
      "title": "QEMU 8.2.2: qcow2_check_refcounts implementation",
      "url": "https://github.com/qemu/qemu/blob/v8.2.2/block/qcow2-refcount.c",
      "accessed": "2026-10-18"
    },
    {
      "id": "libvirt-chain",
      "title": "libvirt: disk image chains, backing formats and relocation",
      "url": "https://libvirt.org/kbase/backing_chains.html",
      "accessed": "2026-10-18"
    }
  ],
  "method": "Nine offline QCOW2 scenarios use four 65536-byte clusters and a known full-byte oracle. A tenth raw-image control compares unequal virtual sizes with a zero tail. 3 repetitions on one host; explicit formats, closed writers, no live VM.",
  "limits": [
    "Synthetic bytes and controlled file mutations, not a VM restore, power-loss test, performance benchmark or failure-rate sample.",
    "One Ubuntu QEMU 8.2.2 package; other versions, options and formats can differ.",
    "Uncompressed, unencrypted images with standard clusters and one raw base; no internal snapshots, external data files or dirty bitmaps.",
    "Successful guest-byte export does not establish guest filesystem, application or multi-disk consistency."
  ],
  "provenance": {
    "harnessSha256": "2fc59fa3eda33d66fe0bfcd20b287ac4f180f8f49ec04a6f85e0659802d932e6",
    "rawSha256": "d790a9c9468910f15e3c49eba9e1e75961f09dfba85534f85bcec06295cddf5d"
  }
}
