qed: Consistency check supportqed-v6
commitfbb8816ebd00ab388087ba21f36a0392ddfae77c
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Wed, 22 Sep 2010 17:07:07 +0000 (22 18:07 +0100)
committerStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Fri, 10 Dec 2010 16:46:18 +0000 (10 16:46 +0000)
tree8fd587675361491b0dc6225bd2397b9be61217e0
parent785c0cd4f7718819818cdf701cbb0379cef4d41a
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>
block/qed-check.c [new file with mode: 0644]
block/qed.c
block/qed.h