[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 2 of 3] tools/libxl: suspend/postflush/commit callbacks

On Wed, Jan 25, 2012 at 3:22 AM, Ian Campbell <Ian.Campbell@xxxxxxxxxx> wrote:
On Mon, 2012-01-23 at 22:46 +0000, rshriram@xxxxxxxxx wrote:
> # HG changeset patch
> # User Shriram Rajagopalan <rshriram@xxxxxxxxx>
> # Date 1327358640 28800
> # Node ID 0446591bee86eb4e767d75b70c885549c7a3cfef
> # Parent  11fb1dfda7de4d6759dec87d80cd16cf137f7369
> tools/libxl: suspend/postflush/commit callbacks
>  * Add libxl callbacks for Remus checkpoint suspend, postflush (aka resume)
>    and checkpoint commit callbacks.
>  * suspend callback just bounces off libxl__domain_suspend_common_callback
>  * resume callback directly calls xc_domain_resume instead of re-using
>    libxl_domain_resume (as the latter does not set the fast suspend argument
>    to xc_domain_resume - aka suspend_cancel support).
>  * commit callback just sleeps for the checkpoint interval (for the moment).
>  * Future patches will augument these callbacks with more functionalities like
>    issuing network buffer plug/unplug commands, disk checkpoint commands, etc.
> Signed-off-by: Shriram Rajagopalan <rshriram@xxxxxxxxx>

> +static int libxl__remus_domain_resume_callback(void *data)
> +{
> +    struct suspendinfo *si = data;
> +    libxl_ctx *ctx = libxl__gc_owner(si->gc);
> +
> +    /* Assumes that SUSPEND_CANCEL is available - just like
> +     * xm version of Remus. Without that, remus wont work.
> +     * Since libxl_domain_resume calls xc_domain_resume with
> +     * fast_suspend = 0, we cant re-use that api.

You could modify that API which would be better than duplicating its
content. I think the "fast" flag is useful to expose to users of libxl
but if not then you could refactor into an internal function which takes
the flag and call it from both here and libxl_domain_resume.

I didnt want to touch any existing public interfaces, structures, etc, especially
something so common like domain_resume. While users of xl resume (or unpause)
wont see any difference, other libraries using the libxl API might be affected.
But I am in favor of "exposing" the flag instead of hiding it in an internal function,
 if there are no objections :).

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.