diff options
author | Luiz Capitulino <lcapitulino@redhat.com> | 2011-09-12 17:54:20 -0300 |
---|---|---|
committer | Luiz Capitulino <lcapitulino@redhat.com> | 2011-10-04 11:02:57 -0300 |
commit | 1fa9a5e4aea36b4d21e42323ae43879c908af576 (patch) | |
tree | c9e8bb26d83383227fc37b3686f2365424bc83cc /hmp.c | |
parent | 0461d5a699cb8825039400b76839115e35b73d65 (diff) | |
download | qemu-1fa9a5e4aea36b4d21e42323ae43879c908af576.tar.gz qemu-1fa9a5e4aea36b4d21e42323ae43879c908af576.tar.bz2 qemu-1fa9a5e4aea36b4d21e42323ae43879c908af576.zip |
qapi: Convert query-status
Please, note that the RunState type as defined in sysemu.h and its
runstate_as_string() function are being dropped in favor of the
RunState type generated by the QAPI.
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 | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -53,3 +53,22 @@ void hmp_info_kvm(Monitor *mon) qapi_free_KvmInfo(info); } +void hmp_info_status(Monitor *mon) +{ + StatusInfo *info; + + info = qmp_query_status(NULL); + + monitor_printf(mon, "VM status: %s%s", + info->running ? "running" : "paused", + info->singlestep ? " (single step mode)" : ""); + + if (!info->running && info->status != RUN_STATE_PAUSED) { + monitor_printf(mon, " (%s)", RunState_lookup[info->status]); + } + + monitor_printf(mon, "\n"); + + qapi_free_StatusInfo(info); +} + |