]> git.proxmox.com Git - mirror_qemu.git/commit - block/qcow2.c
qcow2: link all L2 meta updates in preallocate()
authorStefan Hajnoczi <stefanha@redhat.com>
Tue, 1 Apr 2014 09:12:57 +0000 (11:12 +0200)
committerStefan Hajnoczi <stefanha@redhat.com>
Tue, 1 Apr 2014 13:22:35 +0000 (15:22 +0200)
commitc792707f54aa445cfb63a42411c66594b52b8f79
treedabb21b40bd2f0d4db3246fbaa7f852183d076e1
parent9302e863aa8baa5d932fc078967050c055fa1a7f
qcow2: link all L2 meta updates in preallocate()

preallocate() only links the first QCowL2Meta's data clusters into the
L2 table and ignores any chained QCowL2Metas in the linked list.

Chains of QCowL2Meta structs are built up when contiguous clusters span
L2 tables.  Each QCowL2Meta describes one L2 table update.  This is a
rare case in preallocate() but can happen.

This patch fixes preallocate() by iterating over the whole list of
QCowL2Metas.  Compare with the qcow2_co_writev() function's
implementation, which is similar but also also handles request
dependencies.  preallocate() only performs one allocation at a time so
there can be no dependencies.

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