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

Re: [Xen-devel] [PATCH 20/35] libxl: ao abort: Provide public ao abort request API



On Thu, Jun 25, 2015 at 06:44:20PM +0100, Ian Jackson wrote:
[...]
> + * It is possible to abort even an operation which is being performed
> + * synchronously, but since in that case how==NULL you had better only
> + * have one such operation, because it is not possible to tell them
> + * apart.  (And, if you want to do this, obviously the abort would
> + * have to be requested on a different thread.)
> + */
> +int libxl_ao_abort(libxl_ctx *ctx, const libxl_asyncop_how *how)
> +                   LIBXL_EXTERNAL_CALLERS_ONLY;
> +
> +
>  #define LIBXL_VERSION 0
>  
[...]
> +
> +int libxl_ao_abort(libxl_ctx *ctx, const libxl_asyncop_how *how)
> +{
> +    libxl__ao *search;
> +    libxl__ctx_lock(ctx);
> +    int rc;
> +
> +    LIBXL_LIST_FOREACH(search, &ctx->aos_inprogress, inprogress_entry) {
> +        if (how) {
> +            /* looking for ao to be reported by callback or event */
> +            if (search->poller)
> +                /* sync */
> +                continue;
> +            if (how->callback != search->how.callback)
> +                continue;
> +            if (how->callback
> +                ? (how->u.for_callback != search->how.u.for_callback)
> +                : (how->u.for_event != search->how.u.for_event))
> +                continue;
> +        } else {
> +            /* looking for synchronous call */
> +            if (!search->poller)
> +                /* async */
> +                continue;
> +        }

I interpreted the doc more like "it aborts all sync operations".

This function only aborts the first synchronous operation it finds.
The doc didn't make this clear.

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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