mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
scsi-disk: Clear aiocb on read completion
Once the I/O completion callback returned, aiocb will be released by the controller. So we have to clear the reference not only in scsi_write_complete, but also in scsi_read_complete. Otherwise we risk inconsistencies when a reset hits us before the related request is released. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
e9447f3571
commit
3e94cb0204
1 changed files with 2 additions and 0 deletions
|
@ -125,6 +125,8 @@ static void scsi_read_complete(void * opaque, int ret)
|
|||
{
|
||||
SCSIDiskReq *r = (SCSIDiskReq *)opaque;
|
||||
|
||||
r->req.aiocb = NULL;
|
||||
|
||||
if (ret) {
|
||||
DPRINTF("IO error\n");
|
||||
r->req.bus->complete(r->req.bus, SCSI_REASON_DATA, r->req.tag, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue