info blockstats: show highest_allocated if exists
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.
Signed-off-by Uri Lublin <[email protected]>
--- block.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
block.c +6 -1
@@ -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