]> git.proxmox.com Git - mirror_qemu.git/commit
qcow: allow sub-cluster compressed write to last cluster
authorStefan Hajnoczi <stefanha@redhat.com>
Mon, 15 Apr 2013 15:17:32 +0000 (17:17 +0200)
committerKevin Wolf <kwolf@redhat.com>
Mon, 22 Apr 2013 08:27:58 +0000 (10:27 +0200)
commit16b3c5cd9f27678bc9d6707664640653b47533b9
treef651cee5296cf7f98e270b87854dda286b40c43d
parentf4d38bef7cc79018e2aa789b0e4c23c3a8cdfca5
qcow: allow sub-cluster compressed write to last cluster

Compression in qcow requires image length to be a multiple of the
cluster size.  Lift this requirement by zero-padding the final cluster
when necessary.  The virtual disk size is still not cluster-aligned, so
the guest cannot access the zero sectors.

Note that this is almost identical to the qcow2 version of this code.
qcow2's compression code is drawn from qcow.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/qcow.c