Paolo Bonzini 0eb2baeb44 scsi-generic: let guests recognize readonly=on on passthrough devices
Passed-through SCSI devices can be opened with the readonly=on option.
When this happens, Linux filters away write commands so that the guest
cannot overwrite the contents of the device.

However, the guest does not know that the device is read-only, and
accepts writes.  The writes only fail later when the page cache is
flushed.

This patch modifies scsi-generic to modify the MODE SENSE data and
set the read-only bit in the device-specific parameters, so that
the guest OS treats the disk as write protected.

Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-09-25 12:04:41 +02:00
..
2015-07-27 18:11:53 +03:00
2015-09-11 10:45:43 +03:00
2015-09-14 16:13:16 +01:00
2015-09-14 14:39:49 +01:00
2015-09-07 10:39:30 +01:00
2015-09-18 10:58:56 -04:00
2015-09-09 15:34:53 +02:00
2014-10-24 12:19:11 +01:00
2015-09-11 10:45:43 +03:00
2015-09-07 10:39:28 +01:00
2015-09-23 23:34:17 +02:00
2015-09-23 13:04:49 -06:00
2015-09-11 10:21:38 +03:00
2015-09-11 10:45:43 +03:00