qcow2: allow sub-cluster compressed write to last cluster
commitf4d38bef7cc79018e2aa789b0e4c23c3a8cdfca5
authorStefan Hajnoczi <stefanha@redhat.com>
Mon, 15 Apr 2013 15:17:31 +0000 (15 17:17 +0200)
committerKevin Wolf <kwolf@redhat.com>
Mon, 22 Apr 2013 08:27:58 +0000 (22 10:27 +0200)
treea83c3003f7b316626becabac10cfce1390def876
parent68c0aa6e02f79f8825c0c5dc4c7ed25d524aaa8b
qcow2: allow sub-cluster compressed write to last cluster

Compression in qcow2 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.

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