Am 22.06.2012 17:08, schrieb Stefan Hajnoczi:
> This patch adds an incompatible feature bit to mark images that have not
> been closed cleanly. When a dirty image file is opened a consistency
> check and repair is performed.
>
> Signed-off-by: Stefan Hajnoczi <[email protected]>
> ---
> block/qcow2.c | 44 ++++++++++++++++++++++++++++++++++++++++++--
> block/qcow2.h | 3 +++
> 2 files changed, 45 insertions(+), 2 deletions(-)
> diff --git a/block/qcow2.h b/block/qcow2.h
> index 455b6d7..5c7cfb6 100644
> --- a/block/qcow2.h
> +++ b/block/qcow2.h
> @@ -108,6 +108,9 @@ enum {
> QCOW2_FEAT_TYPE_INCOMPATIBLE = 0,
> QCOW2_FEAT_TYPE_COMPATIBLE = 1,
> QCOW2_FEAT_TYPE_AUTOCLEAR = 2,
> +
> + QCOW2_INCOMPATIBLE_FEAT_DIRTY = 0x1,
> + QCOW2_INCOMPATIBLE_FEAT_MASK = QCOW2_INCOMPATIBLE_FEAT_DIRTY,
> };
I would use a separate enum for each of the three flag categories.
Also, you should add a feature table entry for the dirty bit so that
older qemu versions can display a useful error message.
Kevin