diff mbox

[Qemu-devel] Re: [PATCH 1/2] [scsi-bus]: Add PR-OUT and PR-IN case for SCSIRequest xfer and xfer_mode setup

Message ID 1276693799.12514.226.camel@haakon2.linux-iscsi.org (mailing list archive)
State New, archived
Headers show

Commit Message

Nicholas A. Bellinger June 16, 2010, 1:09 p.m. UTC
None
diff mbox

Patch

diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c
index 75ec74e..7d80405 100644
--- a/hw/scsi-bus.c
+++ b/hw/scsi-bus.c
@@ -329,6 +329,17 @@  static int scsi_req_length(SCSIRequest *req, uint8_t *cmd)
     case PERSISTENT_RESERVE_IN:
         req->cmd.xfer = cmd[8] | (cmd[7] << 8);
         break;
+    case MAINTENANCE_OUT:
+    case MAINTENANCE_IN:
+        if (req->dev->type != TYPE_ROM) {
+            /* Used for MI_REPORT_TARGET_PGS, MO_SET_TARGET_PGS et al. */
+            req->cmd.xfer = cmd[9] | (cmd[8] << 8) |
+                            (cmd[7] << 16) | (cmd[6] << 24);
+        } else {
+            /* GPCMD_REPORT_KEY and GPCMD_SEND_KEY from multi media commands */
+            req->cmd.xfer = cmd[9] | (cmd[8] << 8);
+        }
+        break;
     }

Do you have a problem with leaving this reassignment in for TYPE_ROM..?