mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
scsi: move status to SCSIRequest.
Also add and use the scsi_req_complete() helper function for calling the completion callback. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
251882b7e4
commit
ed3a34a3c8
4 changed files with 27 additions and 15 deletions
|
@ -132,6 +132,7 @@ SCSIRequest *scsi_req_alloc(size_t size, SCSIDevice *d, uint32_t tag, uint32_t l
|
|||
req->dev = d;
|
||||
req->tag = tag;
|
||||
req->lun = lun;
|
||||
req->status = -1;
|
||||
QTAILQ_INSERT_TAIL(&d->requests, req, next);
|
||||
return req;
|
||||
}
|
||||
|
@ -362,3 +363,11 @@ int scsi_req_parse(SCSIRequest *req, uint8_t *buf)
|
|||
req->cmd.lba = scsi_req_lba(req);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void scsi_req_complete(SCSIRequest *req)
|
||||
{
|
||||
assert(req->status != -1);
|
||||
req->bus->complete(req->bus, SCSI_REASON_DONE,
|
||||
req->tag,
|
||||
req->status);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue