]> git.proxmox.com Git - mirror_qemu.git/commit - block/qcow2-cluster.c
qcow2: Check L1 table parameters in qcow2_expand_zero_clusters()
authorAlberto Garcia <berto@igalia.com>
Tue, 6 Mar 2018 16:14:08 +0000 (18:14 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 9 Mar 2018 14:17:47 +0000 (15:17 +0100)
commitc9a442e45094e693da45f0e3d03746d68e4460ec
treecee598bcb6a836264b39b56b8c32aeb97e321782
parent314e8d3928aa82fa13673d47b5af7bdd9a6d82bf
qcow2: Check L1 table parameters in qcow2_expand_zero_clusters()

This function iterates over all snapshots of a qcow2 file in order to
expand all zero clusters, but it does not validate the snapshots' L1
tables first.

We now have a function to take care of this, so let's use it.

We can also take the opportunity to replace the sector-based
bdrv_read() with bdrv_pread().

Cc: Eric Blake <eblake@redhat.com>
Signed-off-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/qcow2-cluster.c
tests/qemu-iotests/080
tests/qemu-iotests/080.out