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>
diff --git a/hmp.c b/hmp.c
index 94a7f74..30925b0 100644
--- a/hmp.c
+++ b/hmp.c
@@ -53,3 +53,22 @@
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);
+}
+