qmp/hmp: add support for system_suspend
PATCH 1/1 qmp/hmp: add support for system_suspend
From: Chen Hanxiao <[email protected]>
This patch add support for system_suspend command.
Signed-off-by Chen Hanxiao <[email protected]>
--- hmp-commands.hx | 14 ++++++++++++++ hmp.c | 5 +++++ hmp.h | 1 + qmp.c | 5 +++++ 4 files changed, 25 insertions(+)
hmp-commands.hx +14 -0
@@ -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",
hmp.c +5 -0
@@ -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;
hmp.h +1 -0
@@ -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);
qmp.c +5 -0
@@ -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 */
Signature · 1 line
1.9.3
Quoted 11 lines · Chen Hanxiao
From: Chen Hanxiao <[email protected]>
This patch add support for
system_suspendcommand.Signed-off-by Chen Hanxiao <[email protected]>--- hmp-commands.hx | 14 ++++++++++++++ hmp.c | 5 +++++ hmp.h | 1 + qmp.c | 5 +++++ 4 files changed, 25 insertions(+)
Generally, adding a function in qmp.c is accompanied by an addition in qapi-schema.json to expose the function via QMP.
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Quoted 12 lines · Eric Blake
Quoted 11 lines · Chen Hanxiao
From: Chen Hanxiao <[email protected]>
This patch add support for
system_suspendcommand.Signed-off-by Chen Hanxiao <[email protected]>--- hmp-commands.hx | 14 ++++++++++++++ hmp.c | 5 +++++ hmp.h | 1 + qmp.c | 5 +++++ 4 files changed, 25 insertions(+)
Quoted 3 lines
Generally, adding a function in
qmp.cis accompanied by an addition in qapi-schema.json to expose the function via QMP.
Sure, I'll post v2 for this.
Regards,
- Chen