qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Chen Hanxiao <chen_han_xiao@126.com>
To: Luiz Capitulino <lcapitulino@redhat.com>,
	Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org, Chen Hanxiao <chen_han_xiao@126.com>
Subject: [Qemu-devel] [PATCH] qmp/hmp: add support for system_suspend
Date: Fri, 27 Nov 2015 23:15:17 +0800	[thread overview]
Message-ID: <1448637317-14213-1-git-send-email-chen_han_xiao@126.com> (raw)

From: Chen Hanxiao <chenhanxiao@gmail.com>

This patch add support for system_suspend command.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
---
 hmp-commands.hx | 14 ++++++++++++++
 hmp.c           |  5 +++++
 hmp.h           |  1 +
 qmp.c           |  5 +++++
 4 files changed, 25 insertions(+)

diff --git a/hmp-commands.hx b/hmp-commands.hx
index bb52e4d..0ee9733 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -619,6 +619,20 @@ Power down the system (if supported).
 ETEXI
 
     {
+        .name       = "system_suspend",
+        .args_type  = "",
+        .params     = "",
+        .help       = "send system suspend event",
+        .mhandler.cmd = hmp_system_suspend,
+    },
+
+STEXI
+@item system_suspend
+@findex system_suspend
+Suspend the system (if supported).
+ETEXI
+
+    {
         .name       = "sum",
         .args_type  = "start:i,size:i",
         .params     = "addr size",
diff --git a/hmp.c b/hmp.c
index 2140605..de4a5f7 100644
--- a/hmp.c
+++ b/hmp.c
@@ -885,6 +885,11 @@ void hmp_system_powerdown(Monitor *mon, const QDict *qdict)
     qmp_system_powerdown(NULL);
 }
 
+void hmp_system_suspend(Monitor *mon, const QDict *qdict)
+{
+    qmp_system_suspend(NULL);
+}
+
 void hmp_cpu(Monitor *mon, const QDict *qdict)
 {
     int64_t cpu_index;
diff --git a/hmp.h b/hmp.h
index a8c5b5a..0064fa0 100644
--- a/hmp.h
+++ b/hmp.h
@@ -44,6 +44,7 @@ void hmp_quit(Monitor *mon, const QDict *qdict);
 void hmp_stop(Monitor *mon, const QDict *qdict);
 void hmp_system_reset(Monitor *mon, const QDict *qdict);
 void hmp_system_powerdown(Monitor *mon, const QDict *qdict);
+void hmp_system_suspend(Monitor *mon, const QDict *qdict);
 void hmp_cpu(Monitor *mon, const QDict *qdict);
 void hmp_memsave(Monitor *mon, const QDict *qdict);
 void hmp_pmemsave(Monitor *mon, const QDict *qdict);
diff --git a/qmp.c b/qmp.c
index 0a1fa19..408e418 100644
--- a/qmp.c
+++ b/qmp.c
@@ -119,6 +119,11 @@ void qmp_system_powerdown(Error **erp)
     qemu_system_powerdown_request();
 }
 
+void qmp_system_suspend(Error **erp)
+{
+    qemu_system_suspend_request();
+}
+
 void qmp_cpu(int64_t index, Error **errp)
 {
     /* Just do nothing */
-- 
1.9.3

             reply	other threads:[~2015-11-27 15:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-27 15:15 Chen Hanxiao [this message]
2015-11-27 17:53 ` [Qemu-devel] [PATCH] qmp/hmp: add support for system_suspend Eric Blake
2015-11-28  2:44   ` Chen Hanxiao

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=1448637317-14213-1-git-send-email-chen_han_xiao@126.com \
    --to=chen_han_xiao@126.com \
    --cc=armbru@redhat.com \
    --cc=lcapitulino@redhat.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).