diff options
author | Luiz Capitulino <lcapitulino@redhat.com> | 2011-09-21 16:38:35 -0300 |
---|---|---|
committer | Luiz Capitulino <lcapitulino@redhat.com> | 2011-10-27 11:48:47 -0200 |
commit | e60a7a8d7c650448ce4d5391e5159e027bacace7 (patch) | |
tree | 28d1735eed9f9ea9d269cc5cbff8cf7724ace31d /hmp.c | |
parent | ec905c33d9b4ed2cf919a6e8a5dcfee00b7c58c7 (diff) | |
download | qemu-e60a7a8d7c650448ce4d5391e5159e027bacace7.tar.gz qemu-e60a7a8d7c650448ce4d5391e5159e027bacace7.tar.bz2 qemu-e60a7a8d7c650448ce4d5391e5159e027bacace7.zip |
qapi: Convert query-cpus
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 | 39 |
1 files changed, 39 insertions, 0 deletions
@@ -145,6 +145,45 @@ void hmp_info_migrate(Monitor *mon) qapi_free_MigrationInfo(info); } +void hmp_info_cpus(Monitor *mon) +{ + CpuInfoList *cpu_list, *cpu; + + cpu_list = qmp_query_cpus(NULL); + + for (cpu = cpu_list; cpu; cpu = cpu->next) { + int active = ' '; + + if (cpu->value->CPU == monitor_get_cpu_index()) { + active = '*'; + } + + monitor_printf(mon, "%c CPU #%" PRId64 ": ", active, cpu->value->CPU); + + if (cpu->value->has_pc) { + monitor_printf(mon, "pc=0x%016" PRIx64, cpu->value->pc); + } + if (cpu->value->has_nip) { + monitor_printf(mon, "nip=0x%016" PRIx64, cpu->value->nip); + } + if (cpu->value->has_npc) { + monitor_printf(mon, "pc=0x%016" PRIx64, cpu->value->pc); + monitor_printf(mon, "npc=0x%016" PRIx64, cpu->value->npc); + } + if (cpu->value->has_PC) { + monitor_printf(mon, "PC=0x%016" PRIx64, cpu->value->PC); + } + + if (cpu->value->halted) { + monitor_printf(mon, " (halted)"); + } + + monitor_printf(mon, " thread_id=%" PRId64 "\n", cpu->value->thread_id); + } + + qapi_free_CpuInfoList(cpu_list); +} + void hmp_quit(Monitor *mon, const QDict *qdict) { monitor_suspend(mon); |