All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/3] block: make BlockConf.*_size properties 32-bit
@ 2020-05-20  8:06 Roman Kagan
  2020-05-20  8:06 ` [PATCH v4 1/3] virtio-blk: store opt_io_size with correct size Roman Kagan
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Roman Kagan @ 2020-05-20  8:06 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Fam Zheng, Daniel P. Berrangé,
	Eduardo Habkost, qemu-block, Michael S. Tsirkin, John Snow,
	Max Reitz, Gerd Hoffmann, Stefan Hajnoczi, Keith Busch,
	Paolo Bonzini

Devices (virtio-blk, scsi, etc.) and the block layer are happy to use
32-bit for logical_block_size, physical_block_size, and min_io_size.
However, the properties in BlockConf are defined as uint16_t limiting
the values to 32768.

This appears unnecessary tight, and we've seen bigger block sizes handy
at times.

Make them 32 bit instead and lift the limitation up to 2 MiB which
appears to be good enough for everybody, and matches the qcow2 cluster
size limit.

As the values can now be fairly big and awkward to type, make the
property setter accept common size suffixes (k, m).

While at this, introduce a few consistency checks on the blocksize-related
values in BlockConf, to prevent their silent truncation or rounding.

Also fix the accessor for opt_io_size in virtio-blk to make it consistent with
the size of the field, and thus synchronize virtio-blk and scsi in the way
opt_io_size is used.

History:
v3 -> v4:
- add patch to opt_io_size width
- add patch to perform consistency checks [Kevin]
- check min_io_size against truncation [Kevin]

v2 -> v3:
- mention qcow2 cluster size limit in the log and comment [Eric]

v1 -> v2:
- cap the property at 2 MiB [Eric]
- accept size suffixes

Roman Kagan (3):
  virtio-blk: store opt_io_size with correct size
  block: consolidate blocksize properties consistency checks
  block: make BlockConf.*_size properties 32-bit

 include/hw/block/block.h     | 10 ++++-----
 include/hw/qdev-properties.h |  2 +-
 hw/block/block.c             | 40 +++++++++++++++++++++++++++++++++++-
 hw/block/fdc.c               |  5 ++++-
 hw/block/nvme.c              |  5 ++++-
 hw/block/virtio-blk.c        |  9 ++------
 hw/core/qdev-properties.c    | 34 +++++++++++++++++++++---------
 hw/ide/qdev.c                |  5 ++++-
 hw/scsi/scsi-disk.c          | 10 +++------
 hw/usb/dev-storage.c         |  5 ++++-
 tests/qemu-iotests/172.out   |  2 +-
 11 files changed, 91 insertions(+), 36 deletions(-)

-- 
2.26.2



^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2020-05-25 15:24 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-20  8:06 [PATCH v4 0/3] block: make BlockConf.*_size properties 32-bit Roman Kagan
2020-05-20  8:06 ` [PATCH v4 1/3] virtio-blk: store opt_io_size with correct size Roman Kagan
2020-05-20  8:48   ` Philippe Mathieu-Daudé
2020-05-20 10:44   ` Michael S. Tsirkin
2020-05-20 21:11     ` Roman Kagan
2020-05-20 15:36   ` Kevin Wolf
2020-05-20 20:34     ` Roman Kagan
2020-05-20  8:06 ` [PATCH v4 2/3] block: consolidate blocksize properties consistency checks Roman Kagan
2020-05-20  8:57   ` Philippe Mathieu-Daudé
2020-05-20  8:59     ` Philippe Mathieu-Daudé
2020-05-20 15:52       ` Kevin Wolf
2020-05-20 15:50     ` Kevin Wolf
2020-05-20 21:31     ` Roman Kagan
2020-05-20  8:06 ` [PATCH v4 3/3] block: make BlockConf.*_size properties 32-bit Roman Kagan
2020-05-20  9:04   ` Philippe Mathieu-Daudé
2020-05-20 21:45     ` Roman Kagan
2020-05-20 15:54   ` Kevin Wolf
2020-05-20 21:50     ` Roman Kagan
2020-05-25 15:20       ` Kevin Wolf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.