block: Add support for DictZip enabled gzip files
authorAlexander Graf <agraf@suse.de>
Wed, 5 Aug 2009 07:49:37 +0000 (09:49 +0200)
committerChanho Park <parkch98@gmail.com>
Tue, 9 Sep 2014 02:32:51 +0000 (11:32 +0900)
commitc9b25b653a0a16df848afb7cb5c8f29eed0c9cb4
tree261b68ee970f6979982448aca15e4861bad9b43e
parent5920d12862fbdc72bcdcfa73bda8f8d9646a00d1
block: Add support for DictZip enabled gzip files

DictZip is an extension to the gzip format that allows random seeks in gzip
compressed files by cutting the file into pieces and storing the piece offsets
in the "extra" header of the gzip format.

Thanks to that extension, we can use gzip compressed files as block backend,
though only in read mode.

This makes a lot of sense when stacked with tar files that can then be shipped
to VM users. If a VM image is inside a tar file that is inside a DictZip
enabled gzip file, the user can run the tar.gz file as is without having to
extract the image first.

Tar patch follows.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Bruce Rogers <brogers@novell.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
[TH: Use bdrv_open options instead of filename]
Signed-off-by: Tim Hardeck <thardeck@suse.de>
[AF: Error **errp added for bdrv_file_open, bdrv_delete -> bdrv_unref]
[AF: qemu_opts_create_nofail() -> qemu_opts_create(),
     bdrv_file_open() -> bdrv_open(), based on work by brogers]
[AF: error_is_set() dropped for v2.1.0-rc0]
Signed-off-by: Andreas Färber <afaerber@suse.de>
block/Makefile.objs
block/dictzip.c [new file with mode: 0644]