]> git.proxmox.com Git - qemu.git/commit
qcow2: Fix L1 table size after bdrv_snapshot_goto
authorKevin Wolf <kwolf@redhat.com>
Fri, 5 Aug 2011 10:06:11 +0000 (12:06 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 5 Aug 2011 12:25:45 +0000 (07:25 -0500)
commit4fbe5233fdaae22b96f9cd5a70351429fa91cce1
treec25af7be12c85d37c1bf8391fb74cab66b03c278
parente2f775205a3523751ac479ec3194eb054376419d
qcow2: Fix L1 table size after bdrv_snapshot_goto

When loading an internal snapshot whose L1 table is smaller than the current L1
table, the size of the current L1 would be shrunk to the snapshot's L1 size in
memory, but not on disk. This lead to incorrect refcount updates and eventuelly
to image corruption.

Instead of writing the new L1 size to disk, this simply retains the bigger L1
size that is currently in use and makes sure that the unused part is zeroed.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Tested-by: Philipp Hahn <hahn@univention.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 35d7ace74bd07e3d6983c1fd7cbfab4e11175689)
block/qcow2-snapshot.c