aboutsummaryrefslogtreecommitdiff
path: root/hmp.c
diff options
context:
space:
mode:
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);
+}
+