From patchwork Wed Jan 16 15:48:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [RFC,V5,25/62] qcow2: Add verification of dedup table. Date: Wed, 16 Jan 2013 05:48:04 -0000 From: =?utf-8?q?Beno=C3=AEt_Canet_=3Cbenoit=40irqsave=2Enet=3E?= X-Patchwork-Id: 212807 Message-Id: <1358351321-4891-26-git-send-email-benoit@irqsave.net> To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, pbonzini@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 6a6719f..34a6a04 100644 --- a/block/qcow2-refcount.c +++ b/block/qcow2-refcount.c @@ -1158,6 +1158,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;