qed: Consistency check support
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Mon, 6 Dec 2010 16:08:03 +0000 (16:08 +0000)
committerKevin Wolf <kwolf@redhat.com>
Fri, 17 Dec 2010 15:11:04 +0000 (16:11 +0100)
commit349b9a60416140b08abba25f358ab7843de88a5c
treeb1dad24f2fc22b73bcf71f58b554715356725033
parent841f0ae14e3170dbddff36660d158862565f4558
qed: Consistency check support

This patch adds support for the qemu-img check command.  It also
introduces a dirty bit in the qed header to mark modified images as
needing a check.  This bit is cleared when the image file is closed
cleanly.

If an image file is opened and it has the dirty bit set, a consistency
check will run and try to fix corrupted table offsets.  These
corruptions may occur if there is power loss while an allocating write
is performed.  Once the image is fixed it opens as normal again.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/qed-check.c [new file with mode: 0644]
block/qed.c
block/qed.h