qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH RFC 06/11] ide: ATAPI-SCSI bridge can now forward re


From: Alexander Bezzubikov
Subject: [Qemu-devel] [PATCH RFC 06/11] ide: ATAPI-SCSI bridge can now forward requests to SCSI
Date: Tue, 18 Aug 2015 02:42:20 +0300

Signed-off-by: Alexander Bezzubikov <address@hidden>
---
 hw/ide/atapi.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c
index 79dd167..6e73910 100644
--- a/hw/ide/atapi.c
+++ b/hw/ide/atapi.c
@@ -1257,5 +1257,21 @@ void ide_atapi_cmd(IDEState *s)
         return;
     }
 
+    if (s->drive_kind == IDE_BRIDGE) {
+        IDEDevice *dev = s->bus->master;
+        SCSIDevice *scsi_dev = scsi_device_find(&dev->scsi_bus, 0, 0, 0);
+        s->cur_req = scsi_new_request_from_bridge(scsi_dev, 0, 0, buf, NULL);
+
+        /* Looks like a hack, but it's better than placing it at scsi_do_read 
*/
+        if (buf[0] == READ_10) {
+            s->status |= BUSY_STAT;
+        }
+
+        if (scsi_req_enqueue(s->cur_req)) {
+            scsi_req_continue(s->cur_req);
+        }
+        return;
+    }
+
     ide_atapi_cmd_error(s, ILLEGAL_REQUEST, ASC_ILLEGAL_OPCODE);
 }
-- 
2.1.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]