Teach block/vdi about "discarded" (no longer allocated) blocks
commitc794b4e0fd9ef8d72b068614dcdb2418c105d5cc
authorEric Sunshine <sunshine@sunshineco.com>
Wed, 26 Oct 2011 19:51:18 +0000 (26 15:51 -0400)
committerKevin Wolf <kwolf@redhat.com>
Fri, 28 Oct 2011 17:25:49 +0000 (28 19:25 +0200)
tree2e4995ea4d74b4a02c59ac61d76926f853211c35
parent0f5314a2c8eeb1b1e775b480e252053157069cf7
Teach block/vdi about "discarded" (no longer allocated) blocks

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 <sunshine@sunshineco.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/vdi.c