qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] scsi: use scsi_req_cancel_async when purging requests
Date: Thu, 17 Dec 2015 09:24:09 +0800	[thread overview]
Message-ID: <20151217012409.GC20007@ad.usersys.redhat.com> (raw)
In-Reply-To: <1450290827-30508-1-git-send-email-pbonzini@redhat.com>

On Wed, 12/16 19:33, Paolo Bonzini wrote:
> This avoids calls to aio_poll without having acquired the context first.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  hw/scsi/scsi-bus.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c
> index fd1171e..524a998 100644
> --- a/hw/scsi/scsi-bus.c
> +++ b/hw/scsi/scsi-bus.c
> @@ -1843,9 +1843,11 @@ void scsi_device_purge_requests(SCSIDevice *sdev, SCSISense sense)
>  
>      while (!QTAILQ_EMPTY(&sdev->requests)) {
>          req = QTAILQ_FIRST(&sdev->requests);
> -        scsi_req_cancel(req);
> +        scsi_req_cancel_async(req, NULL);
>      }
> -
> +    aio_context_acquire(bdrv_get_aio_context(sdev->conf.blk));
> +    blk_drain(sdev->conf.blk);
> +    aio_context_release(bdrv_get_aio_context(sdev->conf.blk));
>      scsi_device_set_ua(sdev, sense);
>  }
>  
> -- 
> 2.5.0
> 
> 

Reviewed-by: Fam Zheng <famz@redhat.com>

      reply	other threads:[~2015-12-17  1:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-16 18:33 [Qemu-devel] [PATCH] scsi: use scsi_req_cancel_async when purging requests Paolo Bonzini
2015-12-17  1:24 ` Fam Zheng [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=20151217012409.GC20007@ad.usersys.redhat.com \
    --to=famz@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).