Hi Daniel,
On 11/28/2011 05:50 PM, Daniel P. Berrange wrote:
On Mon, Nov 28, 2011 at 05:33:22PM +0530, Srivatsa S. Bhat wrote:
> 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.
>
> Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat(a)linux.vnet.ibm.com>
> ---
>
> src/libvirt_private.syms | 7 +
> src/nodeinfo.c | 245 ++++++++++++++++++++++++++++++++++++++++++++++
> src/nodeinfo.h | 9 ++
> src/qemu/qemu_driver.c | 4 +
> 4 files changed, 265 insertions(+), 0 deletions(-)
The nodeinfo.c file were a place to put APIs for collecting info about
the host CPU & memory stats. As such the suspend code does not really
belong there.
Please put it in two new files src/util/virsuspend.[c,h]
and ensure all the internal APIs related to this have the name
prefix 'virSuspend' to match the filename...
How about src/util/virnodesuspend.[c,h]? And a corresponding virNodeSuspend prefix?
Eric Blake raised a point about separating out domain suspend and node suspend
operations, in my previous version of the patchset. So I feel it would be better to
explicitly state what we are doing, by using 'virnodesuspend'. Would that be
fine?
And thanks a lot for the review! I will send an updated version with your comments
addressed.
--
Regards,
Srivatsa S. Bhat
IBM Linux Technology Center