All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>, Dave Scott <Dave.Scott@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Euan Harris <euan.harris@citrix.com>,
	Xen-devel <xen-devel@lists.xen.org>
Subject: Re: Cancelling asynchronous operations in libxl
Date: Thu, 25 Jun 2015 11:40:54 +0100	[thread overview]
Message-ID: <1435228854.32500.31.camel@citrix.com> (raw)
In-Reply-To: <21898.53141.267053.716749@mariner.uk.xensource.com>

On Wed, 2015-06-24 at 16:41 +0100, Ian Jackson wrote:
> Euan Harris writes ("Re: Cancelling asynchronous operations in libxl"):
> > We've discussed the semantics of cancellation a bit more off-list and
> > have come to two conclusions:
> > 
> >   1.  [...]
> > 
> >       We should rename the proposed libxl_ao_cancel() to libxl_ao_abort().
> 
> Unless someone objects to this, I will do this in my next
> rebase/resend.
> 
> (CCing a slightly wider set of people who may be interested in libxl
> API semantics.)

FWIW it seems fine to me...

> 
> >       This function will be defined as a best-effort way to kill an
> >       asynchronous operation, and will give no guarantees about the
> >       state of the affected domain afterwards.   We may add a true
> >       libxl_ao_cancel() function later, with better guarantees about the
> >       state of the domain afterwards.   libxl_ao_abort(), as defined here,
> >       covers many of our requirements in Xapi.
> 
> My plan for implementing (eventually) libxl_ao_cancel is that
> it works my like abort, except that operations can:
> 
>  * block and unblock cancellation during critical sections
> 
>  * declare an ao "committed", causing cancellation requests to all fail
> 
>  * divert cancellation requests to a special handler (which could
>    start to try to undo the operation, for example)
> 
> ...
> >       The semantics of libxl_ao_cancel/_abort() are defined as best effort,
> >       so it suffices to have just two return codes:
> > 
> >         0: The request to cancel/abort has been noted, and it may or may 
> >            not happen.   To find out which, check the eventual return code
> >            of the async operation.
> > 
> >         ERROR_NOTFOUND: the operation to be cancelled has already completed.
> 
> ERROR_NOTFOUND might also mean that the operation has not yet
> started.  For example, the call to libxl_domain_create_new might be on
> its way into libxl and be waiting for the libxl ctx lock.
> 
> Ian.

      reply	other threads:[~2015-06-25 10:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-20 13:50 Cancelling asynchronous operations in libxl Dave Scott
2015-01-20 16:38 ` Ian Jackson
2015-01-28 16:13   ` Euan Harris
2015-01-28 16:57     ` Ian Jackson
2015-02-02 17:43       ` Ian Jackson
2015-02-03  9:59         ` Euan Harris
2015-02-03 12:04           ` Ian Jackson
2015-06-24 15:33       ` Euan Harris
2015-06-24 15:41         ` Ian Jackson
2015-06-25 10:40           ` Ian Campbell [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1435228854.32500.31.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=Dave.Scott@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=euan.harris@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.