mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33:56 -06:00
scsi: Introduce scsi_req_cancel_complete
Let the aio cb do the clean up and notification job after scsi_req_cancel, in preparation for asynchronous cancellation. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
a83cfd12d9
commit
d5776465ee
4 changed files with 20 additions and 4 deletions
|
@ -1718,6 +1718,16 @@ void scsi_req_complete(SCSIRequest *req, int status)
|
|||
scsi_req_unref(req);
|
||||
}
|
||||
|
||||
/* Called by the devices when the request is canceled. */
|
||||
void scsi_req_cancel_complete(SCSIRequest *req)
|
||||
{
|
||||
assert(req->io_canceled);
|
||||
if (req->bus->info->cancel) {
|
||||
req->bus->info->cancel(req);
|
||||
}
|
||||
scsi_req_unref(req);
|
||||
}
|
||||
|
||||
void scsi_req_cancel(SCSIRequest *req)
|
||||
{
|
||||
trace_scsi_req_cancel(req->dev->id, req->lun, req->tag);
|
||||
|
@ -1730,10 +1740,6 @@ void scsi_req_cancel(SCSIRequest *req)
|
|||
if (req->aiocb) {
|
||||
bdrv_aio_cancel(req->aiocb);
|
||||
}
|
||||
if (req->bus->info->cancel) {
|
||||
req->bus->info->cancel(req);
|
||||
}
|
||||
scsi_req_unref(req);
|
||||
}
|
||||
|
||||
static int scsi_ua_precedence(SCSISense sense)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue