On 02/23/2012 01:44 AM, Michal Privoznik wrote:
On 15.02.2012 16:04, Michal Privoznik wrote:
> using 'system-wakeup' monitor command. It is supported only in JSON,
> as we are enabling it if possible. Moreover, this command is available
> in qemu-1.1+ which definitely has JSON.
> ---
> src/qemu/qemu_driver.c | 55 ++++++++++++++++++++++++++++++++++++++++++
> src/qemu/qemu_monitor.c | 19 ++++++++++++++
> src/qemu/qemu_monitor.h | 2 +
> src/qemu/qemu_monitor_json.c | 21 ++++++++++++++++
> src/qemu/qemu_monitor_json.h | 2 +
> 5 files changed, 99 insertions(+), 0 deletions(-)
>
Ping? Eric, it seems to me like you've forgotten this last patch.
Indeed, it fell off my stack of most-recently-pinged patches. Reviewing
now, and thanks for the ping...
using 'system-wakeup' monitor command. It is supported only
in JSON,
as we are enabling it if possible. Moreover, this command is available
in qemu-1.1+ which definitely has JSON.
---
src/qemu/qemu_driver.c | 55 ++++++++++++++++++++++++++++++++++++++++++
src/qemu/qemu_monitor.c | 19 ++++++++++++++
src/qemu/qemu_monitor.h | 2 +
src/qemu/qemu_monitor_json.c | 21 ++++++++++++++++
src/qemu/qemu_monitor_json.h | 2 +
5 files changed, 99 insertions(+), 0 deletions(-)
+static int qemuDomainPMWakeup(virDomainPtr dom,
+ unsigned int flags)
Style nit - we aren't very consistent on whether function names begin on
line 1, but qemu_driver tends to use:
static int
qemuDomainPMWakeup(virDomainPtr dom,
unsigned int flags)
+++ b/src/qemu/qemu_monitor_json.c
@@ -3492,3 +3492,24 @@ int qemuMonitorJSONGetBlockIoThrottle(qemuMonitorPtr mon,
virJSONValueFree(result);
return ret;
}
+
+int qemuMonitorJSONSystemWakeup(qemuMonitorPtr mon)
+{
+ int ret = -1;
+ virJSONValuePtr cmd = NULL;
+ virJSONValuePtr reply = NULL;
+
+ cmd = qemuMonitorJSONMakeCommand("system_wakeup", NULL);
Seems so simple :)
ACK.
--
Eric Blake eblake(a)redhat.com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org