summary refs log tree commit diff stats
path: root/hw/misc/mst_fpga.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2019-07-29 18:33:33 +0200
committerKevin Wolf <kwolf@redhat.com>2019-07-30 13:21:38 +0200
commit7cef3d1290c9d675deff95029ba78e51fb727125 (patch)
tree88b1ecff0fb3ff9587037f39f734b1970fda7411 /hw/misc/mst_fpga.c
parent2b23f28639c9ed3d4cdb1262b3e41b6b81be5e0b (diff)
downloadfocaccia-qemu-7cef3d1290c9d675deff95029ba78e51fb727125.tar.gz
focaccia-qemu-7cef3d1290c9d675deff95029ba78e51fb727125.zip
scsi-cd: Fix inserting read-only media in empty drive
scsi-disks decides whether it has a read-only device by looking at
whether the BlockBackend specified as drive=... is read-only. In the
case of an anonymous BlockBackend (with a node name specified in
drive=...), this is the read-only flag of the attached node. In the case
of an empty anonymous BlockBackend, it's always read-write because
nothing prevented it from being read-write.

This is a problem because scsi-cd would take write permissions on the
anonymous BlockBackend of an empty drive created without a drive=...
option. Using blockdev-insert-medium with a read-only node fails then
with the error message "Block node is read-only".

Fix scsi_realize() so that scsi-cd devices always take read-only
permissions on their BlockBackend instead.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1733920
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'hw/misc/mst_fpga.c')
0 files changed, 0 insertions, 0 deletions