Patchwork [RFC,V1,13/14] qcow2: returns deduplication metrics and status via bdrv_get_info()

login
register
mail settings
Submitter Benoît Canet
Date Jan. 16, 2013, 4:25 p.m.
Message ID <1358353508-5369-14-git-send-email-benoit@irqsave.net>
Download mbox | patch
Permalink /patch/212828/
State New
Headers show

Comments

Benoît Canet - Jan. 16, 2013, 4:25 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;
 }