From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:33940) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJL2t-0006yR-Hf for qemu-devel@nongnu.org; Thu, 27 Oct 2011 04:10:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RJL2r-0007uh-R0 for qemu-devel@nongnu.org; Thu, 27 Oct 2011 04:10:39 -0400 Date: Thu, 27 Oct 2011 08:05:36 +0100 From: Stefan Hajnoczi Message-ID: <20111027070536.GA32265@stefanha-thinkpad.localdomain> References: <1319658678-18355-1-git-send-email-sunshine@sunshineco.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1319658678-18355-1-git-send-email-sunshine@sunshineco.com> Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH] Teach block/vdi about "discarded" (no longer allocated) blocks List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Sunshine Cc: qemu-trivial@nongnu.org, Stefan Weil , qemu-devel@nongnu.org, Kevin Wolf On Wed, Oct 26, 2011 at 03:51:18PM -0400, Eric Sunshine wrote: > An entry in the VDI block map will hold an offset to the actual block if > the block is allocated, or one of two specially-interpreted values if > not allocated. Using VirtualBox terminology, value VDI_IMAGE_BLOCK_FREE > (0xffffffff) represents a never-allocated block (semantically arbitrary > content). VDI_IMAGE_BLOCK_ZERO (0xfffffffe) represents a "discarded" > block (semantically zero-filled). block/vdi knows only about > VDI_IMAGE_BLOCK_FREE. Teach it about VDI_IMAGE_BLOCK_ZERO. > > Signed-off-by: Eric Sunshine > --- > > Without this patch, "qemu-image check" on a VDI image containing > discarded blocks reports errors such as: > > ERROR: block index 3434 too large, is 4294967294 > > Decimal 4294967294 is 0xfffffffe. Worse, "qemu-image convert" or direct > access of the VDI image from qemu involves reads and writes of blocks at > the bogus block offset 4294967294 within the image file. > > Cc: Stefan Weil > Cc: Kevin Wolf > > block/vdi.c | 23 ++++++++++++++--------- > 1 files changed, 14 insertions(+), 9 deletions(-) Good to see this improvement. I recently talked to a CernVM developer who had issues with vdi images. This may fix the issue they were seeing. I think Kevin should take this through the block tree. I won't apply it to trivial-patches. Stefan