scsi-disk: fix double completion of failing passthrough requests
authorPaolo Bonzini <pbonzini@redhat.com>
Sat, 13 Oct 2018 09:49:16 +0000 (11:49 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 19 Oct 2018 11:44:12 +0000 (13:44 +0200)
commite6aa5ba4ac423dd282c831402110970ee278392e
treeb258493db8888e443164a005e313b955431fbabb
parenta519e3894436501c5c6da5e82f6b867d2c05afb5
scsi-disk: fix double completion of failing passthrough requests

If a command fails with a sense that scsi_sense_buf_to_errno converts to
ECANCELED/EAGAIN/ENOTCONN or with a unit attention, scsi_req_complete is
called twice.  This caused a crash.

Reported-by: Wangguang <wang.guangA@h3c.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/scsi/scsi-disk.c