]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Implement the core API to suspend/resume the host
authorSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Tue, 29 Nov 2011 09:07:38 +0000 (17:07 +0800)
committerDaniel Veillard <veillard@redhat.com>
Tue, 29 Nov 2011 09:29:17 +0000 (17:29 +0800)
commit4ddb37c3953a3db70e8c2c2bb20be5fada984039
treeaa255e8a65d2b43074ad5aa3bbf5b0747dde9c39
parent76da40a820c16d551624511a49dea3353216604a
Implement the core API to suspend/resume the host

Add the core functions that implement the functionality of the API.
Suspend is done by using an asynchronous mechanism so that we can return
the status to the caller before the host gets suspended. This asynchronous
operation is achieved by suspending the host in a separate thread of
execution. However, returning the status to the caller is only best-effort,
but not guaranteed.

To resume the host, an RTC alarm is set up (based on how long we want to
suspend) before suspending the host. When this alarm fires, the host
gets woken up.

Suspend-to-RAM operation on a host running Linux can take upto more than 20
seconds, depending on the load of the system. (Freezing of tasks, an operation
preceding any suspend operation, is given up after a 20 second timeout).
And Suspend-to-Disk can take even more time, considering the time required
for compaction, creating the memory image and writing it to disk etc.
So, we do not allow the user to specify a suspend duration of less than 60
seconds, to be on the safer side, since we don't want to prematurely declare
failure when we only had to wait for some more time.
po/POTFILES.in
src/Makefile.am
src/libvirt.c
src/libvirt_private.syms
src/lxc/lxc_driver.c
src/qemu/qemu_driver.c
src/uml/uml_driver.c
src/util/virnodesuspend.c [new file with mode: 0644]
src/util/virnodesuspend.h [new file with mode: 0644]
src/xen/xen_driver.c