qcow2: Make qemu-img check detect corrupted L1 tables in snapshots
commit0c2ada8136a993b1fae9cee2c26b357e9c56c016
authorAlberto Garcia <berto@igalia.com>
Tue, 6 Mar 2018 16:14:12 +0000 (6 18:14 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 9 Mar 2018 14:17:47 +0000 (9 15:17 +0100)
tree73a42021cb247729f0b834a31d114927ed381814
parentdb5794f1f17d1f8247c0ea8e6f0376a47b112466
qcow2: Make qemu-img check detect corrupted L1 tables in snapshots

'qemu-img check' cannot detect if a snapshot's L1 table is corrupted.
This patch checks the table's offset and size and reports corruption
if the values are not valid.

This patch doesn't add code to fix that corruption yet, only to detect
and report it.

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-refcount.c
tests/qemu-iotests/080
tests/qemu-iotests/080.out