From: Ian Jackson Subject: Re: FW: Cancelling asynchronous operations in libxl Date: Mon, 28 Oct 2013 15:52:02 +0000 Message-ID: <21102.34850.365297.10422@mariner.uk.xensource.com> References: <4B8F5D33B081C044AA43634E84ED7F9616A83D@AMSPEX01CL03.citrite.net> <20131023172329.GE28413@phenom.dumpdata.com> <1382776392.22417.179.camel@hastur.hellion.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1382776392.22417.179.camel@hastur.hellion.org.uk> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: Simon Beaumont , "xs-devel@lists.xenserver.org" , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org Ian Campbell writes ("Re: [Xen-devel] FW: Cancelling asynchronous operations in libxl"): > On Wed, 2013-10-23 at 13:23 -0400, Konrad Rzeszutek Wilk wrote: > > Are there specific operations that you are focusing on to cancel? > > Yes, this would be good to know. Ian J would know better than I but AIUI > there is currently no generic support for cancelling an asynchronous op > in libxl. I'm sure we could find a way to add this, for example as an > abort after the current "step" succeeds/times out/fails. That's right. I think the right approach would be to provide a new kind of ao_how value which returns a reference to the caller which can be used for cancellation. Cancellation would itself be asynchronous, in the sense that you sould request cancellation but then still have to wait for the operation to end. So initially you could implement cancellation for only a subset of operations and have the infrastructure disregard cancellation requests for operations which don't support it. I think the most obvious operation that should be cancellable is domain migration. Ideally there would be some kind of automatic plumbing which would arrange (for example) that callers to the libxl xs watch functions, or timeout functions, would get a "cancellation" notice instead. > For killing libxl_domain_destroy should be fine to call even if there is > an async op pending on that domain, the async op will naturally fail, > it'll probably log a lot but should do so gracefully. If there are cases > which do not we should fix them, since they would represent a bug > irrespective of any killing of the domain from under the op's feet. Yes. Ian.