From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=42365 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PTchl-0007Vv-6u for qemu-devel@nongnu.org; Fri, 17 Dec 2010 10:58:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PTchT-0004a9-8d for qemu-devel@nongnu.org; Fri, 17 Dec 2010 10:58:34 -0500 Received: from mtagate1.uk.ibm.com ([194.196.100.161]:53316) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PTchT-0004ZR-1k for qemu-devel@nongnu.org; Fri, 17 Dec 2010 10:58:31 -0500 Received: from d06nrmr1307.portsmouth.uk.ibm.com (d06nrmr1307.portsmouth.uk.ibm.com [9.149.38.129]) by mtagate1.uk.ibm.com (8.13.1/8.13.1) with ESMTP id oBHFwT8A016787 for ; Fri, 17 Dec 2010 15:58:29 GMT Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by d06nrmr1307.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id oBHFwUWn2781224 for ; Fri, 17 Dec 2010 15:58:30 GMT Received: from d06av03.portsmouth.uk.ibm.com (localhost.localdomain [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id oBHFwSdp023574 for ; Fri, 17 Dec 2010 08:58:28 -0700 From: Stefan Hajnoczi Date: Fri, 17 Dec 2010 15:58:21 +0000 Message-Id: <1292601502-5222-3-git-send-email-stefanha@linux.vnet.ibm.com> In-Reply-To: <1292601502-5222-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1292601502-5222-1-git-send-email-stefanha@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 2/3] docs: Describe zero data clusters in QED specification List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi Zero data clusters are a space-efficient way of storing zeroed regions of the image. Signed-off-by: Stefan Hajnoczi --- docs/specs/qed_spec.txt | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/docs/specs/qed_spec.txt b/docs/specs/qed_spec.txt index 1d5fa87..7982e05 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,13 @@ 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. + ===Logical offset translation=== Logical offsets are translated into cluster offsets as follows: -- 1.7.2.3