summaryrefslogtreecommitdiffstats
path: root/hw/scsi.h
diff options
context:
space:
mode:
authorJan Kiszka2010-07-13 14:13:45 +0200
committerAurelien Jarno2010-07-22 05:52:10 +0200
commite8637c9013609271772cc0c3436cb1240cd6b034 (patch)
tree28f83503b6085bf81e99a7b31fe120cc192916ab /hw/scsi.h
parente1000: Fix wrong microwire EEPROM state initialization (diff)
downloadqemu-e8637c9013609271772cc0c3436cb1240cd6b034.tar.gz
qemu-e8637c9013609271772cc0c3436cb1240cd6b034.tar.xz
qemu-e8637c9013609271772cc0c3436cb1240cd6b034.zip
scsi: Dequeue requests before invoking completion callback
The request completion callback of the LSI controller may start the next request that can use the same tag as the completed one. As the latter is still enqueued at that point, scsi_send_command will complain about the tag reuse and cancel the completed request. That will cause a double free later on when the completion path cleans up as well. Fix this by dequeuing the request before invoking the callback. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'hw/scsi.h')
-rw-r--r--hw/scsi.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/scsi.h b/hw/scsi.h
index 4fbf1d5dfd..cb06d6d824 100644
--- a/hw/scsi.h
+++ b/hw/scsi.h
@@ -43,6 +43,7 @@ typedef struct SCSIRequest {
enum SCSIXferMode mode;
} cmd;
BlockDriverAIOCB *aiocb;
+ bool enqueued;
QTAILQ_ENTRY(SCSIRequest) next;
} SCSIRequest;