Re: [Qemu-devel] [PATCH v4 7/7] virtio-scsi: Handle TMF request cancellation asynchronously

2014-09-29 Thread Fam Zheng
On Mon, 09/29 12:56, Paolo Bonzini wrote: > @@ -241,7 +235,6 @@ static int virtio_scsi_do_tmf(VirtIOSCSI *s, > VirtIOSCSIReq *req) > BusChild *kid; > int target; > int ret = 0; > -int cancel_count; > > if (s->dataplane_started && bdrv_get_aio_context(d->conf.bs) != s->ctx

Re: [Qemu-devel] [PATCH v4 7/7] virtio-scsi: Handle TMF request cancellation asynchronously

2014-09-29 Thread Fam Zheng
On Mon, 09/29 12:56, Paolo Bonzini wrote: > Il 29/09/2014 12:11, Paolo Bonzini ha scritto: > > Il 28/09/2014 03:48, Fam Zheng ha scritto: > >> +virtio_scsi_complete_req(req); > >> +} else { > >> +assert(r = -EINPROGRESS); > >> +} > >> } > > > > = instead of == here. > > >

Re: [Qemu-devel] [PATCH v4 7/7] virtio-scsi: Handle TMF request cancellation asynchronously

2014-09-29 Thread Paolo Bonzini
Il 29/09/2014 12:11, Paolo Bonzini ha scritto: > Il 28/09/2014 03:48, Fam Zheng ha scritto: >> +virtio_scsi_complete_req(req); >> +} else { >> +assert(r = -EINPROGRESS); >> +} >> } > > = instead of == here. > > Apart from this, the patch looks good. Thanks! Hmm, there's

Re: [Qemu-devel] [PATCH v4 7/7] virtio-scsi: Handle TMF request cancellation asynchronously

2014-09-29 Thread Paolo Bonzini
Il 28/09/2014 03:48, Fam Zheng ha scritto: > +virtio_scsi_complete_req(req); > +} else { > +assert(r = -EINPROGRESS); > +} > } = instead of == here. Apart from this, the patch looks good. Thanks! Paolo

[Qemu-devel] [PATCH v4 7/7] virtio-scsi: Handle TMF request cancellation asynchronously

2014-09-27 Thread Fam Zheng
For VIRTIO_SCSI_T_TMF_ABORT_TASK and VIRTIO_SCSI_T_TMF_ABORT_TASK_SET, use scsi_req_cancel_async to start the cancellation. Because each tmf command may cancel multiple requests, we need to use a counter to track the number of remaining requests we still need to wait for. Signed-off-by: Fam Zheng