[V3,2/2] virtio-block: support auto-sensing of block sizes

Message ID 511A48C7.3050802@de.ibm.com
State New
Headers show

Commit Message

Christian Borntraeger Feb. 12, 2013, 1:51 p.m.
On 08/02/13 15:52, Einar Lueck wrote:
> Virtio-blk does not impose fixed block sizes for access to
> backing devices. This patch introduces support for auto
> lookup of the block sizes of the backing block device. This
> automatic lookup needs to be enabled explicitly. Users may
> do this by specifying (physical|logical)_block_size=0.
> Machine types may do this for their defaults, too.
> To achieve this, a new function blkconf_blocksizes is
> implemented. If physical or logical block size are zero
> a corresponding ioctl tries to find an appropriate value.
> If this does not work, 512 is used. blkconf_blocksizes
> is therefore only called w/in the virtio-blk context.
> For s390-virtio, this patch configures auto lookup as
> default. For virtio-ccw, this is already a default in
> the existing upstream implementation.
> Signed-off-by: Einar Lueck <elelueck@linux.vnet.ibm.com>

together with the patch below:
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>

s390: enable block size auto-sensing also for virtio-ccw

The ccw transport for s390 should also enable block size

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>


diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index d92e427..f6a08b2 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -731,7 +731,7 @@  static const TypeInfo virtio_ccw_net = {
 static Property virtio_ccw_blk_properties[] = {
     DEFINE_PROP_STRING("devno", VirtioCcwDevice, bus_id),
-    DEFINE_BLOCK_PROPERTIES(VirtioCcwDevice, blk.conf),
+    DEFINE_BLOCK_PROPERTIES_EXTENDED(VirtioCcwDevice, blk.conf, 0),
     DEFINE_PROP_STRING("serial", VirtioCcwDevice, blk.serial),
 #ifdef __linux__
     DEFINE_PROP_BIT("scsi", VirtioCcwDevice, blk.scsi, 0, true),