From: Ian Campbell Subject: Re: [PATCH 2 of 3] tools/libxl: suspend/postflush/commit callbacks Date: Thu, 26 Jan 2012 09:23:17 +0000 Message-ID: <1327569797.26983.25.camel@zakaz.uk.xensource.com> References: <0446591bee86eb4e767d.1327358787@athos.nss.cs.ubc.ca> <1327490558.24561.294.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "rshriram@cs.ubc.ca" Cc: "brendan@cs.ubc.ca" , "xen-devel@lists.xensource.com" , Ian Jackson List-Id: xen-devel@lists.xenproject.org On Wed, 2012-01-25 at 23:15 +0000, Shriram Rajagopalan wrote: > On Wed, Jan 25, 2012 at 3:22 AM, Ian Campbell > wrote: > On Mon, 2012-01-23 at 22:46 +0000, rshriram@cs.ubc.ca wrote: > > # HG changeset patch > > # User Shriram Rajagopalan > > # 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 > > > > > > > +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. Until Xen 4.2 it is fine to improve the public interface of libxl, including adding a new parameter here if you think that is best. > While users of xl resume (or unpause) wont see any difference, other > libraries using the libxl API might be affected. So long as they can still ask for the current behaviour that is fine. > But I am in favor of "exposing" the flag instead of hiding it in an > internal function, if there are no objections :). None. Ian.