Create and destroy the metadata list on creation and destruction of a
qcow2 BDS, respectively. Skip creation if no overlap checks should be
performed.
Signed-off-by: Max Reitz <address@hidden>
---
block/qcow2.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/block/qcow2.c b/block/qcow2.c
index ed88d69..f80f9ed 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -744,6 +744,13 @@ static int qcow2_open(BlockDriverState *bs, QDict
*options, int flags,
overlap_check_template & (1 << i)) << i;
}
+ if (s->overlap_check) {
+ ret = qcow2_create_empty_metadata_list(bs, 65536, errp);