From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45777) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2VmC-0000my-G6 for qemu-devel@nongnu.org; Fri, 27 Nov 2015 22:02:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a2Vm8-0005Po-GL for qemu-devel@nongnu.org; Fri, 27 Nov 2015 22:02:16 -0500 Received: from m50-110.126.com ([123.125.50.110]:48381) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2Vm7-0005PV-SP for qemu-devel@nongnu.org; Fri, 27 Nov 2015 22:02:12 -0500 From: Chen Hanxiao Date: Sat, 28 Nov 2015 11:01:46 +0800 Message-Id: <1448679706-23771-3-git-send-email-chen_han_xiao@126.com> In-Reply-To: <1448679706-23771-1-git-send-email-chen_han_xiao@126.com> References: <1448679706-23771-1-git-send-email-chen_han_xiao@126.com> Subject: [Qemu-devel] [PATCH v2 2/2] hmp: add support for system_suspend List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino , Markus Armbruster , eblake@redhat.com Cc: qemu-devel@nongnu.org, Chen Hanxiao From: Chen Hanxiao This patch add support for system_suspend hmp command. Signed-off-by: Chen Hanxiao --- hmp-commands.hx | 14 ++++++++++++++ hmp.c | 5 +++++ hmp.h | 1 + 3 files changed, 20 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); -- 1.9.3