mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
qapi: Convert query-blockstats
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
parent
b202381800
commit
f11f57e405
6 changed files with 143 additions and 81 deletions
34
hmp.c
34
hmp.c
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue