mirror of https://github.com/xemu-project/xemu.git
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
|
@ -125,6 +125,8 @@ static void scsi_read_complete(void * opaque, int ret)
|
||||||
{
|
{
|
||||||
SCSIDiskReq *r = (SCSIDiskReq *)opaque;
|
SCSIDiskReq *r = (SCSIDiskReq *)opaque;
|
||||||
|
|
||||||
|
r->req.aiocb = NULL;
|
||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
DPRINTF("IO error\n");
|
DPRINTF("IO error\n");
|
||||||
r->req.bus->complete(r->req.bus, SCSI_REASON_DATA, r->req.tag, 0);
|
r->req.bus->complete(r->req.bus, SCSI_REASON_DATA, r->req.tag, 0);
|
||||||
|
|
Loading…
Reference in New Issue