summaryrefslogtreecommitdiff
path: root/block/qed.h
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>2010-12-06 16:08:03 +0000
committerKevin Wolf <kwolf@redhat.com>2010-12-17 16:11:04 +0100
commit01979a98d75b49c2acbbbb71521c285f8d8f9fb7 (patch)
treeb1dad24f2fc22b73bcf71f58b554715356725033 /block/qed.h
parenteabba580e6bb8d6b969c1368c6f90d72b4cde4f4 (diff)
downloadqemu-01979a98d75b49c2acbbbb71521c285f8d8f9fb7.tar.gz
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>
Diffstat (limited to 'block/qed.h')
-rw-r--r--block/qed.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/block/qed.h b/block/qed.h
index 046a4102c0..2925e37b1c 100644
--- a/block/qed.h
+++ b/block/qed.h
@@ -50,11 +50,15 @@ enum {
/* The image supports a backing file */
QED_F_BACKING_FILE = 0x01,
+ /* The image needs a consistency check before use */
+ QED_F_NEED_CHECK = 0x02,
+
/* The backing file format must not be probed, treat as raw image */
QED_F_BACKING_FORMAT_NO_PROBE = 0x04,
/* Feature bits must be used when the on-disk format changes */
QED_FEATURE_MASK = QED_F_BACKING_FILE | /* supported feature bits */
+ QED_F_NEED_CHECK |
QED_F_BACKING_FORMAT_NO_PROBE,
QED_COMPAT_FEATURE_MASK = 0, /* supported compat feature bits */
QED_AUTOCLEAR_FEATURE_MASK = 0, /* supported autoclear feature bits */