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 <sunsh...@sunshineco.com> > --- > > 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 <w...@mail.berlios.de> > Cc: Kevin Wolf <kw...@redhat.com> > > 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