diff options
author | Luiz Capitulino <lcapitulino@redhat.com> | 2011-09-22 15:56:36 -0300 |
---|---|---|
committer | Luiz Capitulino <lcapitulino@redhat.com> | 2011-10-27 11:48:47 -0200 |
commit | f11f57e405a99732ed0f3294904c2dd258d77629 (patch) | |
tree | 2844d1e1833f22050f5ed63dd06b7e935abd9beb /hmp.c | |
parent | b202381800d81fbff9978abbdea95760dd363bb6 (diff) | |
download | qemu-f11f57e405a99732ed0f3294904c2dd258d77629.zip qemu-f11f57e405a99732ed0f3294904c2dd258d77629.tar.gz qemu-f11f57e405a99732ed0f3294904c2dd258d77629.tar.bz2 |
qapi: Convert query-blockstats
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'hmp.c')
-rw-r--r-- | hmp.c | 34 |
1 files changed, 34 insertions, 0 deletions
@@ -226,6 +226,40 @@ void hmp_info_block(Monitor *mon) qapi_free_BlockInfoList(block_list); } +void hmp_info_blockstats(Monitor *mon) +{ + BlockStatsList *stats_list, *stats; + + stats_list = qmp_query_blockstats(NULL); + + for (stats = stats_list; stats; stats = stats->next) { + if (!stats->value->has_device) { + continue; + } + + monitor_printf(mon, "%s:", stats->value->device); + monitor_printf(mon, " rd_bytes=%" PRId64 + " wr_bytes=%" PRId64 + " rd_operations=%" PRId64 + " wr_operations=%" PRId64 + " flush_operations=%" PRId64 + " wr_total_time_ns=%" PRId64 + " rd_total_time_ns=%" PRId64 + " flush_total_time_ns=%" PRId64 + "\n", + stats->value->stats->rd_bytes, + stats->value->stats->wr_bytes, + stats->value->stats->rd_operations, + stats->value->stats->wr_operations, + stats->value->stats->flush_operations, + stats->value->stats->wr_total_time_ns, + stats->value->stats->rd_total_time_ns, + stats->value->stats->flush_total_time_ns); + } + + qapi_free_BlockStatsList(stats_list); +} + void hmp_quit(Monitor *mon, const QDict *qdict) { monitor_suspend(mon); |