Skip to contentSkip to conversation

info blockstats: show highest_allocated if exists

PATCH In review Uri Lublin 1 participant 1 message Jan 8, 2009

lore
Share & tools
lore

Uri Lublin

author
#0 lore raw

PATCH 3/3 info blockstats: show highest_allocated if exists

From: Uri Lublin <[email protected]>

Using bdrv_get_info() to
1. get more interesting stats later
2. print the info only for block formats that support it.

---
 block.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
block.c +6 -1
index 82959d6..5305b27 100644
@@ -1124,6 +1124,7 @@ void bdrv_info(void)
 void bdrv_info_stats (void)
 {
     BlockDriverState *bs;
+    BlockDriverInfo bdi;
 
     for (bs = bdrv_first; bs != NULL; bs = bs->next) {
 	term_printf ("%s:"
@@ -1131,10 +1132,14 @@ void bdrv_info_stats (void)
 		     " wr_bytes=%" PRIu64
 		     " rd_operations=%" PRIu64
 		     " wr_operations=%" PRIu64
-		     "\n",
+                     ,
 		     bs->device_name,
 		     bs->rd_bytes, bs->wr_bytes,
 		     bs->rd_ops, bs->wr_ops);
+        if (bdrv_get_info(bs, &bdi) == 0)
+            term_printf(" high=%" PRIu64,
+                        bdi.highest_alloc);
+        term_printf("\n");
     }
 }
 
Signature · 1 line
1.6.0.6