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

Submitted by Benoît Canet on Feb. 6, 2013, 12:32 p.m.

Details

Message ID 1360153939-9563-16-git-send-email-benoit@irqsave.net
State New
Headers show

Commit Message

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

Patch hide | download patch | download mbox

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;
 }