From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49442) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xwtxb-0008Af-KR for qemu-devel@nongnu.org; Fri, 05 Dec 2014 09:34:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XwtxV-0001I3-FD for qemu-devel@nongnu.org; Fri, 05 Dec 2014 09:34:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47278) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwtxV-0001Gf-7i for qemu-devel@nongnu.org; Fri, 05 Dec 2014 09:34:13 -0500 Date: Fri, 5 Dec 2014 09:34:04 -0500 From: Jeff Cody Message-ID: <20141205143404.GA2433@localhost.localdomain> References: <1417775209-11812-1-git-send-email-kwolf@redhat.com> <20141205114922.GC6040@noname.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141205114922.GC6040@noname.str.redhat.com> Subject: Re: [Qemu-devel] [PATCH] vhdx: Return true for bdrv_has_zero_init List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: amulya.lokesha@emc.com, qemu-devel@nongnu.org, stefanha@redhat.com, mreitz@redhat.com On Fri, Dec 05, 2014 at 12:49:22PM +0100, Kevin Wolf wrote: > Am 05.12.2014 um 11:26 hat Kevin Wolf geschrieben: > > Like for most other image formats, vhdx images read as all zero in qemu > > after their creation (we're taking advantage from the fact that qemu has > > just created the image, because PAYLOAD_BLOCK_NOT_PRESENT actually means > > undefined rather than zeroed according to the spec). > > > > This fixes that 'qemu-img convert' to vhdx fully populates the image. > > > > Signed-off-by: Kevin Wolf > > Jeff, another thing that Max found while we looked at the spec is that > the 1.0 spec defines PAYLOAD_BLOCK_UNMAPPED as 3, but we define it as 5. > It appears that the 0.95 spec actually had it that way. > > Should we handle both 3 and 5 as unmapped? > Wow - you are right, I checked the 1.0 spec change history. Since one of the valid actions is to read zeros for PAYLOAD_BLOCK_UNMAPPED, it would seem safe to do that for a technically undefined state of '5', especially since that will maintain backwards compatibility of 0.95-spec images. So I think 'yes'.