qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Fam Zheng <famz@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v3 4/8] linux-aio: Implement .cancel_async
Date: Tue, 2 Sep 2014 15:55:00 +0100	[thread overview]
Message-ID: <20140902145500.GK29067@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1409107756-5967-5-git-send-email-famz@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 730 bytes --]

On Wed, Aug 27, 2014 at 10:49:12AM +0800, Fam Zheng wrote:
> @@ -110,6 +109,22 @@ static void qemu_laio_completion_cb(EventNotifier *e)
>      }
>  }
>  
> +static void laio_cancel_async(BlockDriverAIOCB *blockacb)
> +{
> +    struct qemu_laiocb *laiocb = (struct qemu_laiocb *)blockacb;
> +    struct io_event event;
> +    int ret;
> +
> +    ret = io_cancel(laiocb->ctx->ctx, &laiocb->iocb, &event);
> +    laiocb->ret = -ECANCELED;
> +    if (!ret) {
> +        /* iocb is not cancelled, cb will be called by the event loop later */
> +        return;
> +    }

This comment doesn't make sense, io_cancel() returns 0 on success so it
has been cancelled.  We need to call the completion callback!

Stefan

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2014-09-02 14:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-27  2:49 [Qemu-devel] [PATCH v3 0/8] block: Asynchronous request cancellation Fam Zheng
2014-08-27  2:49 ` [Qemu-devel] [PATCH v3 1/8] block: Add refcnt in BlockDriverAIOCB Fam Zheng
2014-08-27  2:49 ` [Qemu-devel] [PATCH v3 2/8] block: Add bdrv_aio_cancel_async Fam Zheng
2014-09-02 10:55   ` Stefan Hajnoczi
2014-08-27  2:49 ` [Qemu-devel] [PATCH v3 3/8] tests: Add testing code for bdrv_aio_cancel_async Fam Zheng
2014-08-27  2:49 ` [Qemu-devel] [PATCH v3 4/8] linux-aio: Implement .cancel_async Fam Zheng
2014-09-02 14:55   ` Stefan Hajnoczi [this message]
2014-08-27  2:49 ` [Qemu-devel] [PATCH v3 5/8] thread-pool: " Fam Zheng
2014-08-27  2:49 ` [Qemu-devel] [PATCH v3 6/8] dma: " Fam Zheng
2014-08-27  2:49 ` [Qemu-devel] [PATCH v3 7/8] block: Implement bdrv_em_co_aiocb_info.cancel_async Fam Zheng
2014-08-27  2:49 ` [Qemu-devel] [PATCH v3 8/8] iscsi: Implement .cancel_async in acb info Fam Zheng
2014-09-02 15:09 ` [Qemu-devel] [PATCH v3 0/8] block: Asynchronous request cancellation Stefan Hajnoczi
2014-09-03  0:35   ` Fam Zheng

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=20140902145500.GK29067@stefanha-thinkpad.redhat.com \
    --to=stefanha@redhat.com \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).