(This patch is positioned to go in after the patch that exports the host power management capabilities as XML, posted in [4])
This patch adds a new API to put a host to a suspended state (either Suspend-to-RAM or Suspend-to-Disk) and setup a timed resume to get the host back online, 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]. v3: * Rebased to libvirt 0.9.7 * Added a check to see if alarmTime (suspend duration) is within an acceptable range. 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 v2: http://comments.gmane.org/gmane.comp.emulators.libvirt/46729 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-November/msg00378.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 | 48 +++++++++ src/libvirt_private.syms | 7 + src/libvirt_public.syms | 1 src/nodeinfo.c | 220 ++++++++++++++++++++++++++++++++++++++++++ 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, 339 insertions(+), 2 deletions(-) -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list