summaryrefslogtreecommitdiff
path: root/hmp.c
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2011-09-12 17:54:20 -0300
committerLuiz Capitulino <lcapitulino@redhat.com>2011-10-04 11:02:57 -0300
commit1fa9a5e4aea36b4d21e42323ae43879c908af576 (patch)
treec9e8bb26d83383227fc37b3686f2365424bc83cc /hmp.c
parent0461d5a699cb8825039400b76839115e35b73d65 (diff)
downloadqemu-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.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/hmp.c b/hmp.c
index 94a7f74483..30925b037e 100644
--- a/hmp.c
+++ b/hmp.c
@@ -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);
+}
+