I see. Thanks.
On Fri, Apr 19, 2013 at 10:58 AM, Paolo Bonzini <[email protected]> wrote: > Il 19/04/2013 09:53, Dmitry Fleytman ha scritto: > > Paolo, thanks for review. > > > > Regarding the change - it's ok with me, but why do one needs this? I > > think we always set proper status before request cancellation. > > May QEMU call cancel callback on its own? > > The cancel callback should not be run if the command is completed (what > happens is that scsi_req_cancel will call _either_ the complete callback > or the cancel callback). However, we had bugs in the past on this and > I'm not sure all of them have been stomped. > > The outer "if" statement is the equivalent of this in virtio-scsi.c > > if (!req) { > return; > } > > if (req->dev->resetting) { > ... > } > > So it may even be better if I follow the scheme in virtio-scsi.c and do > this: > > if (r->completed) { > return; > } > > if (pvscsi_req->dev->resetting) { > pvscsi_req->cmp.hostStatus = BTSTAT_BUSRESET; > } else { > pvscsi_req->cmp.hostStatus = BTSTAT_ABORTQUEUE; > } > > pvscsi_complete_request(s, pvscsi_req); > > Paolo >
