Re: [PATCH v2 0/7] scsi: scsi_debug: Add more tape support

"Kai Mäkisara (Kolumbus)"
2025-02-24T15:15:17Z

> On 24. Feb 2025, at 5.19, Martin K. Petersen <martin.petersen@oracle.com> wrote:
>
>
> Kai,
>
>> Currently, the scsi_debug driver can create tape devices and the st
>> driver attaches to those. Nothing much can be done with the tape
>> devices because scsi_debug does not have support for the tape-specific
>> commands and features. These patches add some more tape support to the
>> scsi_debug driver. The end result is simulated drives with a tape
>> having one or two partitions (one partition is created initially).
>
> Applied to 6.15/scsi-staging, thanks!
>
> Unless I'm missing something, you'll need to update the report supported
> operation codes bitmasks for the commands that are defined in both SBC
> and SSC (READ(6), WRITE(6), ...).
>
I have tried to keep the changes minimal in definitions used by the existing
code. The definitions for READ (6), WRITE (6), etc., seemed to be permissive
enough not to affect the tape additions.

The command definitions in scsi_debug are common to all devices. This
means that it reports as supported opcodes anything that is defined for
any device. It also tries to execute any command, unless it is restricted
for certain device types in the code. (sg_opcodes reports the tape
commands as supported, so this works also in practice.)

(Conceptually, it would be possible to add a device type mask to
struct opcode_info_t. The code already supports lists of definitions
and making list traversal check the device type mask would enable
using different definitions for different device types. This was not
absolutely necessary to add the tape support, and I tried to avoid
changes in the core functionality of scsi_debug.)

Thanks, Kai