qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: armbru@redhat.com, dgilbert@redhat.com,
	mdroth@linux.vnet.ibm.com,
	Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCH 2/3] hmp: introduce wakeup-from-suspend-support command
Date: Wed,  6 Dec 2017 10:02:16 -0200	[thread overview]
Message-ID: <20171206120217.11392-3-danielhb@linux.vnet.ibm.com> (raw)
In-Reply-To: <20171206120217.11392-1-danielhb@linux.vnet.ibm.com>

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 <danielhb@linux.vnet.ibm.com>
---
 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
+@item info wakeup_from_suspend_support
+@findex 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

  parent reply	other threads:[~2017-12-06 12:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-06 12:02 [Qemu-devel] [PATCH 0/3] qmp/hmp: wakeup-from-suspend-support command Daniel Henrique Barboza
2017-12-06 12:02 ` [Qemu-devel] [PATCH 1/3] qmp: introduce query-wakeup-from-suspend-support command Daniel Henrique Barboza
2017-12-06 14:26   ` Eric Blake
2017-12-06 15:50     ` Daniel Henrique Barboza
2017-12-21 19:03       ` Daniel Henrique Barboza
2017-12-06 12:02 ` Daniel Henrique Barboza [this message]
2017-12-06 12:02 ` [Qemu-devel] [PATCH 3/3] qga: update guest-suspend-ram and guest-suspend-hybrid descriptions Daniel Henrique Barboza
2017-12-21 19:23 ` [Qemu-devel] [PATCH 0/3] qmp/hmp: wakeup-from-suspend-support command no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171206120217.11392-3-danielhb@linux.vnet.ibm.com \
    --to=danielhb@linux.vnet.ibm.com \
    --cc=armbru@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).