Skip to contentSkip to conversation

target: Handle GET_EVENT_STATUS_NOTIFICATION passthrough

PATCH Applied Stefan Hajnoczi 2 participants 2 messages Apr 30, 2012 – May 4, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target: Handle GET_EVENT_STATUS_NOTIFICATION passthrough

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.

---
 drivers/target/target_core_transport.c |    4 ++++
 1 file changed, 4 insertions(+)
drivers/target/target_core_transport.c +4 -0
index a953ca0..5b83fd2 100644
@@ -3146,6 +3146,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",
Signature · 1 line
1.7.10
#1 lore raw
Quoted 16 lines · Stefan Hajnoczi

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.

---
 drivers/target/target_core_transport.c |    4 ++++
 1 file changed, 4 insertions(+)
drivers/target/target_core_transport.c +0 -0
index a953ca0..5b83fd2 100644

drivers/target/target_core_transport.c static int transport_generic_cmd_sequencer( · line 3155

Quoted 10 lines
drivers/target/target_core_transport.c +4 -0
@@ -3146,6 +3146,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",

Applied to lio-core, and will get this added into for-next for 3.5-rc1

Thanks Cong + Stefan!

--nab