qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 2/3] hmp: introduce wakeup-from-suspend-support comm


From: Daniel Henrique Barboza
Subject: [Qemu-devel] [PATCH 2/3] hmp: introduce wakeup-from-suspend-support command
Date: Wed, 6 Dec 2017 10:02:16 -0200

This is the HMP side of 'query-wakeup-from-suspend-support', a new
QMP command that queries the guest support for system_wakeup.

This is the expected output of the new command when running a
x86 guest:

(qemu) info wakeup_from_suspend_support
wake up from suspend support: enabled
(qemu)

And when running a pseries guest:

(qemu) info wakeup_from_suspend_support
wake up from suspend support: disabled
(qemu)

Signed-off-by: Daniel Henrique Barboza <address@hidden>
---
 hmp-commands-info.hx | 15 +++++++++++++++
 hmp.c                | 11 +++++++++++
 hmp.h                |  1 +
 3 files changed, 27 insertions(+)

diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx
index 54c3e5eac6..9d5e93bfcf 100644
--- a/hmp-commands-info.hx
+++ b/hmp-commands-info.hx
@@ -867,6 +867,21 @@ Display the amount of initially allocated and present 
hotpluggable (if
 enabled) memory in bytes.
 ETEXI
 
+    {
+        .name       = "wakeup_from_suspend_support",
+        .args_type  = "",
+        .params     = "",
+        .help       = "shows if the guest has support for wake up "
+                      "from suspend",
+        .cmd        = hmp_info_wakeup_from_suspend_support,
+    },
+
+STEXI
address@hidden info wakeup_from_suspend_support
address@hidden info wakeup_from_suspend_support
+Shows if the guest has support for wake up from suspended state.
+ETEXI
+
 STEXI
 @end table
 ETEXI
diff --git a/hmp.c b/hmp.c
index 35a7041824..3b74b9ee19 100644
--- a/hmp.c
+++ b/hmp.c
@@ -2918,3 +2918,14 @@ void hmp_info_memory_size_summary(Monitor *mon, const 
QDict *qdict)
     }
     hmp_handle_error(mon, &err);
 }
+
+void hmp_info_wakeup_from_suspend_support(Monitor *mon, const QDict *qdict)
+{
+    WakeupSuspendSupportInfo *info;
+
+    info = qmp_query_wakeup_from_suspend_support(NULL);
+    monitor_printf(mon, "wake up from suspend support: %s\n",
+                   info->enabled ? "enabled" : "disabled");
+
+    qapi_free_WakeupSuspendSupportInfo(info);
+}
diff --git a/hmp.h b/hmp.h
index a6f56b1f29..2d394cbec2 100644
--- a/hmp.h
+++ b/hmp.h
@@ -147,5 +147,6 @@ void hmp_info_ramblock(Monitor *mon, const QDict *qdict);
 void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict);
 void hmp_info_vm_generation_id(Monitor *mon, const QDict *qdict);
 void hmp_info_memory_size_summary(Monitor *mon, const QDict *qdict);
+void hmp_info_wakeup_from_suspend_support(Monitor *mon, const QDict *qdict);
 
 #endif
-- 
2.13.6




reply via email to

[Prev in Thread] Current Thread [Next in Thread]