Patchwork [RFC,V2,15/16] qcow2: returns deduplication metrics and status via bdrv_get_info()

login
register
mail settings
Submitter Benoît Canet
Date Feb. 6, 2013, 12:32 p.m.
Message ID <1360153939-9563-16-git-send-email-benoit@irqsave.net>
Download mbox | patch
Permalink /patch/218586/
State New
Headers show

Comments

Benoît Canet - Feb. 6, 2013, 12:32 p.m.
---
 block/qcow2.c |    4 ++++
 1 file changed, 4 insertions(+)

Patch

diff --git a/block/qcow2.c b/block/qcow2.c
index 514811a..0ee5f4b 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1864,6 +1864,10 @@  static int qcow2_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
     BDRVQcowState *s = bs->opaque;
     bdi->cluster_size = s->cluster_size;
     bdi->vm_state_offset = qcow2_vm_state_offset(s);
+    bdi->has_dedup = s->has_dedup;
+    bdi->dedup_status = s->dedup_status;
+    qcow2_dedup_update_metrics(bs);
+    memcpy(&bdi->dedup_metrics, &s->dedup_metrics, sizeof(bdi->dedup_metrics));
     return 0;
 }