Closed liulanzheng closed 2 years ago
Do you have any use case for this ?
@lxbsz in overlaybd, we output container images as block device through libtcmu for data acceleration. Images, like overlaybd containerd images, and vm images, also iso images, are readonly, it is better to provided a method to mark the device as readonly fundamentally, which is significantly better than executing blockdev --setro command on client. At first, we use tgtd as the backstore and it has readonly option for target configuration. So i think adding an option for write-protect/readonly is a real need.
BTW, which spc or sbc you are referring to for orig_buf[3]
and orig_buf[2]
? From the sbc for MODE_SENSE_10 the first 8 bytes are reserved only for the NUMBER OF LOGICAL BLOCKS
, and for MODE_SENSE there are 4 bytes.
BTW, which spc or sbc you are referring to for
orig_buf[3]
andorig_buf[2]
? From the sbc for MODE_SENSE_10 the first 8 bytes are reserved only for theNUMBER OF LOGICAL BLOCKS
, and for MODE_SENSE there are 4 bytes.
Okay, I misread the docs and I see it.
As discussed in #654, add an api to set write-protect for dev, and set the corresponding parameter when mode sense.
Signed-off-by: liulanzheng lanzheng.liulz@alibaba-inc.com