Patchwork [RFC,V5,49/62] qcow2: returns deduplication metrics and status via bdrv_get_info()

login
register
mail settings
Submitter Benoît Canet
Date Jan. 16, 2013, 3:48 p.m.
Message ID <1358351321-4891-50-git-send-email-benoit@irqsave.net>
Download mbox | patch
Permalink /patch/213037/
State New
Headers show

Comments

Benoît Canet - Jan. 16, 2013, 3:48 p.m.
---
 block/qcow2.c |    4 ++++
 1 file changed, 4 insertions(+)

Patch

diff --git a/block/qcow2.c b/block/qcow2.c
index 753fce0..e442268 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1868,6 +1868,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_running = s->dedup_status == QCOW_DEDUP_STARTED;
+    qcow2_dedup_update_metrics(bs);
+    memcpy(&bdi->dedup_metrics, &s->dedup_metrics, sizeof(bdi->dedup_metrics));
     return 0;
 }