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 <[email protected]>
Reviewed-by: John Snow <[email protected]>
Message-id:
1420566495[email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>