scsi: Don't ignore most usb-storage properties
commit3089637461693837cafd2709ef36d0cf6a4a8ed8
authorKevin Wolf <kwolf@redhat.com>
Wed, 31 Jan 2024 13:06:07 +0000 (31 14:06 +0100)
committerKevin Wolf <kwolf@redhat.com>
Wed, 7 Feb 2024 14:25:13 +0000 (7 15:25 +0100)
treea1ff7ba7bdacc0fe4d7141577f922a3accb62ddf
parentb3d9bb9a560316b125dae5fb18924523d004d3dd
scsi: Don't ignore most usb-storage properties

usb-storage is for the most part just a wrapper around an internally
created scsi-disk device. It uses DEFINE_BLOCK_PROPERTIES() to offer all
of the usual block device properties to the user, but then only forwards
a few select properties to the internal device while the rest is
silently ignored.

This changes scsi_bus_legacy_add_drive() to accept a whole BlockConf
instead of some individual values inside of it so that usb-storage can
now pass the whole configuration to the internal scsi-disk. This enables
the remaining block device properties, e.g. logical/physical_block_size
or discard_granularity.

Buglink: https://issues.redhat.com/browse/RHEL-22375
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-ID: <20240131130607.24117-1-kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/scsi/scsi-bus.c
hw/usb/dev-storage-classic.c
include/hw/scsi/scsi.h