From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43857) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDuxW-00012Y-7I for qemu-devel@nongnu.org; Fri, 08 Mar 2013 05:55:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDuxQ-0008Nl-I9 for qemu-devel@nongnu.org; Fri, 08 Mar 2013 05:55:30 -0500 Date: Fri, 8 Mar 2013 11:54:50 +0100 From: Stefan Hajnoczi Message-ID: <20130308105450.GC32107@stefanha-thinkpad.redhat.com> References: <1362589321-21402-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1362589321-21402-1-git-send-email-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [PATCH] qcow2: make is_allocated return true for zero clusters List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, qemu-stable@nongnu.org On Wed, Mar 06, 2013 at 06:02:01PM +0100, Paolo Bonzini wrote: > Otherwise, live migration of the top layer will miss zero clusters and > let the backing file show through. This also matches what is done in qed. > > QCOW2_CLUSTER_ZERO clusters are invalid in v2 image files. Check this > directly in qcow2_get_cluster_offset instead of replicating the test > everywhere. > > Cc: qemu-stable@nongnu.org > Signed-off-by: Paolo Bonzini > --- > block/qcow2.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Stefan Hajnoczi The qcow2 spec says: Bit 0: If set to 1, the cluster reads as all zeros. The host cluster offset can be used to describe a preallocation, but it won't be used for reading data from this cluster, nor is data read from the backing file if the cluster is unallocated. Your patch makes zero clusters "allocated", which does not violate the preallocation case.