]> git.proxmox.com Git - mirror_qemu.git/commit
block/dmg: improve zeroes handling
authorPeter Wu <peter@lekensteyn.nl>
Tue, 6 Jan 2015 17:48:15 +0000 (18:48 +0100)
committerKevin Wolf <kwolf@redhat.com>
Fri, 6 Feb 2015 16:24:21 +0000 (17:24 +0100)
commit177b75104da3e3a9af84975c32a44782d903c41f
treea7c059a84c67cf93249d0ef8058fc47f964d878c
parent6b383c08c46468ecee98ecf71ffd8362e9bd7f42
block/dmg: improve zeroes handling

Disk images may contain large all-zeroes gaps (1.66k sectors or 812 MiB
is seen in the real world). These blocks (type 2) do not need to be
extracted into a temporary buffer, there is no need to allocate memory
for these blocks nor to check its length.

(For the test image, the maximum uncompressed size is 1054371 bytes,
probably for a bzip2-compressed block.)

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: John Snow <jsnow@redhat.com>
Message-id: 1420566495-13284-13-git-send-email-peter@lekensteyn.nl
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/dmg.c