From patchwork Mon Nov 26 13:05:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [RFC,V3,19/24] qcow2: Add verification of dedup table. Date: Mon, 26 Nov 2012 03:05:18 -0000 From: =?utf-8?q?Beno=C3=AEt_Canet?= X-Patchwork-Id: 201697 Message-Id: <1353935123-24199-20-git-send-email-benoit@irqsave.net> To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, =?UTF-8?q?Beno=C3=AEt=20Canet?= , stefanha@redhat.com Signed-off-by: Benoit Canet --- block/qcow2-refcount.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index efc1179..16aa8a2 100644 --- a/block/qcow2-refcount.c +++ b/block/qcow2-refcount.c @@ -1168,6 +1168,14 @@ int qcow2_check_refcounts(BlockDriverState *bs, BdrvCheckResult *res, goto fail; } + if (s->has_dedup) { + ret = check_refcounts_l1(bs, res, refcount_table, nb_clusters, + s->dedup_table_offset, s->dedup_table_size, 0); + if (ret < 0) { + goto fail; + } + } + /* snapshots */ for(i = 0; i < s->nb_snapshots; i++) { sn = s->snapshots + i;