qcow2: Fix L1 table memory allocation
authorKevin Wolf <kwolf@redhat.com>
Tue, 7 Jul 2009 16:09:42 +0000 (18:09 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 10 Jul 2009 18:44:29 +0000 (13:44 -0500)
commit1bf2494ec7a66b306801bbe642ea03c4057f1f89
treead855afc990fe0a4fd24c9c7082821649c3e48fc
parent5a89d1bdc45e07e2b8c18f0d635baa1a47bef2ca
qcow2: Fix L1 table memory allocation

Contrary to what one could expect, the size of L1 tables is not cluster
aligned. So as we're writing whole sectors now instead of single entries,
we need to ensure that the L1 table in memory is large enough; otherwise
write would access memory after the end of the L1 table.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
block/qcow2-cluster.c
block/qcow2-refcount.c
block/qcow2.c