From f4233a87ec48adf6081b29a3c28dabee5072465c Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Mon, 8 Aug 2011 16:13:52 -0700 Subject: [RHEL6 qemu-kvm PATCH 09/19] docs: Describe zero data clusters in QED specification RH-Author: Anthony Liguori Message-id: <1312820040-2612-10-git-send-email-aliguori@redhat.com> Patchwork-id: 31104 O-Subject: [RHEL6.2 qemu PATCH 09/17] docs: Describe zero data clusters in QED specification Bugzilla: 633380 RH-Acked-by: Kevin Wolf RH-Acked-by: Paolo Bonzini From: Stefan Hajnoczi Zero data clusters are a space-efficient way of storing zeroed regions of the image. Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf Signed-off-by: Anthony Liguori Bugzilla: 633380 Signed-off-by: Eduardo Habkost --- docs/specs/qed_spec.txt | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/docs/specs/qed_spec.txt b/docs/specs/qed_spec.txt index 1d5fa87..0c81208 100644 --- a/docs/specs/qed_spec.txt +++ b/docs/specs/qed_spec.txt @@ -89,6 +89,7 @@ L1, L2, and data cluster offsets must be aligned to header.cluster_size. The fo ===Data cluster offsets=== * 0 - unallocated. The data cluster is not yet allocated. +* 1 - zero. The data cluster contents are all zeroes and no cluster is allocated. Future format extensions may wish to store per-offset information. The least significant 12 bits of an offset are reserved for this purpose and must be set to zero. Image files with cluster_size > 2^12 will have more unused bits which should also be zeroed. @@ -97,6 +98,20 @@ Reads to an unallocated area of the image file access the backing file. If ther Writes to an unallocated area cause a new data clusters to be allocated, and a new L2 table if that is also unallocated. The new data cluster is populated with data from the backing file (or zeroes if no backing file) and the data being written. +===Zero data clusters=== +Zero data clusters are a space-efficient way of storing zeroed regions of the image. + +Reads to a zero data cluster produce zeroes. Note that the difference between an unallocated and a zero data cluster is that zero data clusters stop the reading of contents from the backing file. + +Writes to a zero data cluster cause a new data cluster to be allocated. The new data cluster is populated with zeroes and the data being written. + +===Zero data clusters=== +Zero data clusters are a space-efficient way of storing zeroed regions of the image. + +Reads to a zero data cluster produce zeroes. Note that the difference between an unallocated and a zero data cluster is that zero data clusters stop the reading of contents from the backing file. + +Writes to a zero data cluster cause a new data cluster to be allocated. The new data cluster is populated with zeroes and the data being written. + ===Logical offset translation=== Logical offsets are translated into cluster offsets as follows: -- 1.7.3.2