aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@amazon.com>2014-01-24 15:50:14 -0800
committerAnthony Liguori <aliguori@amazon.com>2014-01-24 15:50:14 -0800
commite9f526ab7b01662c323a47446e22308968221ac1 (patch)
tree58f91d4bfe27f82108db0e15bd41661f7a2282b1 /hw
parent0d688cf7d8d71bce2aab83173552a784e96b6729 (diff)
parent1cb27d9233d572826b45bd8498d2fab1b6f01df9 (diff)
Merge remote-tracking branch 'bonzini/scsi-next' into staging
* bonzini/scsi-next: scsi: Support TEST UNIT READY in the dummy LUN0 block: add .bdrv_reopen_prepare() stub for iscsi virtio-scsi: Prevent assertion on missed events virtio-scsi: Cleanup of I/Os that never started scsi: Assign cancel_io vector for scsi_disk_emulate_ops Conflicts: block/iscsi.c aliguori: resolve trivial merge conflict in block/iscsi.c Signed-off-by: Anthony Liguori <aliguori@amazon.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/scsi/scsi-bus.c2
-rw-r--r--hw/scsi/scsi-disk.c1
-rw-r--r--hw/scsi/virtio-scsi.c6
3 files changed, 8 insertions, 1 deletions
diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c
index 3496c0bbd8..50b89ad4aa 100644
--- a/hw/scsi/scsi-bus.c
+++ b/hw/scsi/scsi-bus.c
@@ -469,6 +469,8 @@ static int32_t scsi_target_send_command(SCSIRequest *req, uint8_t *buf)
r->req.dev->sense_is_ua = false;
}
break;
+ case TEST_UNIT_READY:
+ break;
default:
scsi_req_build_sense(req, SENSE_CODE(LUN_NOT_SUPPORTED));
scsi_req_complete(req, CHECK_CONDITION);
diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index 649109150b..a8d0f15ebe 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -2306,6 +2306,7 @@ static const SCSIReqOps scsi_disk_emulate_reqops = {
.send_command = scsi_disk_emulate_command,
.read_data = scsi_disk_emulate_read_data,
.write_data = scsi_disk_emulate_write_data,
+ .cancel_io = scsi_cancel_io,
.get_buf = scsi_get_buf,
};
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
index 6dcdd1b91c..6610b3aab3 100644
--- a/hw/scsi/virtio-scsi.c
+++ b/hw/scsi/virtio-scsi.c
@@ -306,6 +306,10 @@ static void virtio_scsi_command_complete(SCSIRequest *r, uint32_t status,
VirtIOSCSIReq *req = r->hba_private;
uint32_t sense_len;
+ if (r->io_canceled) {
+ return;
+ }
+
req->resp.cmd->response = VIRTIO_SCSI_S_OK;
req->resp.cmd->status = status;
if (req->resp.cmd->status == GOOD) {
@@ -516,7 +520,7 @@ static void virtio_scsi_push_event(VirtIOSCSI *s, SCSIDevice *dev,
evt->event = event;
evt->reason = reason;
if (!dev) {
- assert(event == VIRTIO_SCSI_T_NO_EVENT);
+ assert(event == VIRTIO_SCSI_T_EVENTS_MISSED);
} else {
evt->lun[0] = 1;
evt->lun[1] = dev->id;