Subject: vnd: improving support for compressed images
To: None <tech-kern@NetBSD.org>
From: Dieter Baron <dillo@NetBSD.org>
List: tech-kern
Date: 06/29/2007 15:39:39
hi,

adding support for more compressed disk image formats to vnd raises
the question what should be done in the kernel and what in user space.
I can think of three solutions:

1) Tell the kernel the file name (and optionally the format), and let
   the kernel parse the image file.

2) Let the vnconfig parse the image file and pass a hunk descriptor
   list to the kernel, like the following:
	first block in hunk
	number of blocks in hunk
	offset in file for hunk data
	compression method (none, zero-fill, zlib, bzip2, ...)

3) create a pass-to-userspace disk framework (like puffs, but for
   disks) and implement everything in user space.

  Personally, I prefer method 2: it keeps code in the kernel small and
simple, allows enough flexibility to support quite a few common
formats (including Linux's CLoop2 and Apple's DMG) and is simpler and
faster than method 3.

  We can always add option 3 later if we want.

  Your thoughts?

					yours,
					dillo