target: Handle GET_EVENT_STATUS_NOTIFICATION passthrough
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Mon, 30 Apr 2012 15:35:13 +0000 (16:35 +0100)
committerNicholas Bellinger <nab@linux-iscsi.org>
Sun, 6 May 2012 22:02:33 +0000 (15:02 -0700)
The SCSI MMC GET_EVENT_STATUS_NOTIFICATION command can be used to find
out about media change, among other things.  This patch adds it to the
command sequencer so that PSCSI CD-ROM passthrough works with modern
Linux guests that issue this command.

Tested-by: Cong Meng <mengcong@cn.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_transport.c

index 28945d9996136c472ef8d2e9ccf9918ea6a812e2..901fb2905aede6df449995d6ff03720a16879783 100644 (file)
@@ -3143,6 +3143,10 @@ static int transport_generic_cmd_sequencer(
                        cmd->sam_task_attr = MSG_HEAD_TAG;
                cmd->se_cmd_flags |= SCF_SCSI_CONTROL_SG_IO_CDB;
                break;
+       case GET_EVENT_STATUS_NOTIFICATION:
+               size = (cdb[7] << 8) | cdb[8];
+               cmd->se_cmd_flags |= SCF_SCSI_CONTROL_SG_IO_CDB;
+               break;
        default:
                pr_warn("TARGET_CORE[%s]: Unsupported SCSI Opcode"
                        " 0x%02x, sending CHECK_CONDITION.\n",