This patch adds a new API to put a host to a suspended state (either
Suspend-to-RAM or Suspend-to-Disk) and also resume the host back from within
libvirt. This uses the RTC wakeup mechanism to set up a timer alarm before
suspending the host, so that in-band resume is facilitated by the firing
of the RTC alarm, which wakes up the host.
The decision to use the RTC Wakeup mechanism to resume the host from
sleep was taken in [1]. An initial API was discussed in [2].
Some design ideas for the asynchronous mechanism implementation was
discussed in [3].
This patch is positioned to go in along with the patch that exports
the host power management capabilities as XML, posted in [4].
v2:
* Added an init function which finds out if S3/S4 is supported by the host,
upon the first request to suspend/hibernate.
* Added synchronization/locking to ensure that only one suspend operation
is active at a time.
v1:
http://www.redhat.com/archives/libvir-list/2011-September/msg00830.html
References:
[1].
http://www.redhat.com/archives/libvir-list/2011-August/msg00327.html
[2].
http://www.redhat.com/archives/libvir-list/2011-August/msg00248.html
[3].
http://www.redhat.com/archives/libvir-list/2011-September/msg00438.html
[4].
http://www.redhat.com/archives/libvir-list/2011-August/msg00324.html
Srivatsa S. Bhat (2):
Implement the asynchronous suspend and RTC wakeup
Make the API public
include/libvirt/libvirt.h.in | 9 ++
src/driver.h | 5 +
src/libvirt.c | 46 +++++++++
src/libvirt_private.syms | 7 +
src/libvirt_public.syms | 1
src/nodeinfo.c | 215 ++++++++++++++++++++++++++++++++++++++++++
src/nodeinfo.h | 14 +++
src/qemu/qemu_driver.c | 6 +
src/remote/remote_driver.c | 1
src/remote/remote_protocol.x | 12 ++
src/util/threads-pthread.c | 17 +++
src/util/threads.h | 1
12 files changed, 332 insertions(+), 2 deletions(-)