qemu-patch-raspberry4/hw/scsi
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
..
esp-pci.c scsi: Convert remaining PCI HBAs to realize() 2015-03-10 11:18:23 +01:00
esp.c esp: Do not overwrite ESP_TCHI after reset 2014-11-12 10:27:03 +01:00
lsi53c895a.c scsi: Convert remaining PCI HBAs to realize() 2015-03-10 11:18:23 +01:00
Makefile.objs virtio-scsi-dataplane: Code to run virtio-scsi on iothread 2014-09-30 11:11:20 +02:00
megasas.c megasas: Add write function to handle write access to PCI BAR 3 2015-07-27 23:05:49 +02:00
mfi.h megasas: add MegaRAID SAS 2108 emulation 2014-10-31 11:29:00 +01:00
scsi-bus.c scsi: create restart bottom half in the right AioContext 2015-08-14 23:40:32 +02:00
scsi-disk.c scsi-disk: identify AIO callbacks more clearly 2015-08-14 23:40:32 +02:00
scsi-generic.c scsi-generic: let guests recognize readonly=on on passthrough devices 2015-09-25 12:04:41 +02:00
spapr_vscsi.c spapr_vio: Convert to realize() 2015-03-09 15:00:07 +01:00
srp.h spapr-vscsi: add task management 2013-09-12 08:46:21 +02:00
vhost-scsi.c vhost-scsi: fix wrong vhost-scsi firmware path 2015-09-09 15:34:55 +02:00
viosrp.h hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
virtio-scsi-dataplane.c virtio-scsi-dataplane: fix memory leak for VirtIOSCSIVring 2015-03-26 14:23:16 +01:00
virtio-scsi.c virtio: avoid leading underscores for helpers 2015-09-10 11:06:05 +03:00
vmw_pvscsi.c pci: Don't register a specialized 'config_write' if default behavior is intended 2015-06-19 12:17:49 +02:00
vmw_pvscsi.h scsi: VMWare PVSCSI paravirtual device implementation 2013-04-19 10:44:17 +02:00