Enter the image header into the metadata list to protect it against accidental modifications.
Signed-off-by: Max Reitz <mre...@redhat.com> Reviewed-by: Eric Blake <ebl...@redhat.com> --- block/qcow2.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/qcow2.c b/block/qcow2.c index d30d008..9815325 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -774,6 +774,8 @@ static int qcow2_open(BlockDriverState *bs, QDict *options, int flags, } } + qcow2_metadata_list_enter(bs, 0, 1, QCOW2_OL_MAIN_HEADER); + s->refcount_table_offset = header.refcount_table_offset; s->refcount_table_size = header.refcount_table_clusters << (s->cluster_bits - 3); -- 2.4.6