qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-block] [PATCH v4 04/17] qcow2/overlaps: Protect image header


From: Max Reitz
Subject: [Qemu-block] [PATCH v4 04/17] qcow2/overlaps: Protect image header
Date: Mon, 4 May 2015 21:15:40 +0200

Enter the image header into the metadata list to protect it against
accidental modifications.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]