Received: from eggs.gnu.org ([2001:4830:134:3::10]:51162) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpLqh-00063E-07 for qemu-devel@nongnu.org; Mon, 04 May 2015 15:16:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YpLqf-0001oy-S9 for qemu-devel@nongnu.org; Mon, 04 May 2015 15:16:14 -0400 From: Max Reitz Date: Mon, 4 May 2015 21:15:40 +0200 Message-Id: <1430766953-6913-5-git-send-email-mreitz@redhat.com> In-Reply-To: <1430766953-6913-1-git-send-email-mreitz@redhat.com> References: <1430766953-6913-1-git-send-email-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH v4 04/17] qcow2/overlaps: Protect image header List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi , Max Reitz Enter the image header into the metadata list to protect it against accidental modifications. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- block/qcow2.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/qcow2.c b/block/qcow2.c index b15a612..fc53b34 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -766,6 +766,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.3.7