Closed Gaelan closed 3 years ago
Well that is what pass-through devices are for. Either /dev/sg
Aha, /dev/bsg did it. I'd tried to find a passthrough device earlier, but I didn't have a /dev/sg, and lsscsi couldn't find it either. Didn't know about bsg. Thanks a ton!
BTW sg_luns has a --readonly option that should also work. Use --help or the man page to see available options. Many man pages include examples.
sg3_utils fails to communicate with a write-protected SCSI block device (i.e. one that sets the WP bit in its response to MODE SENSE):
Turning off the WP bit (and changing nothing else—I'm writing a target emulator, and it doesn't even implement WRITE yet) causes sg3_utils to work fine.
Not sure if this is a bug in sg3_utils or the kernel (or if I'm missing some way to make it work), but I'm opening it here first in hopes you all will know where the problem is.
The SCSI device in question is an experimental vhost-user-scsi implementation. It appears to the guest—running in QEMU—as a virtio-scsi device.