]> git.proxmox.com Git - mirror_qemu.git/commit - hw/block/virtio-blk.c
block: consolidate blocksize properties consistency checks
authorRoman Kagan <rvkagan@yandex-team.ru>
Thu, 28 May 2020 22:55:10 +0000 (01:55 +0300)
committerKevin Wolf <kwolf@redhat.com>
Wed, 17 Jun 2020 12:53:40 +0000 (14:53 +0200)
commitc56ee92fcba8cc922b1b2188ac20614d20223db2
tree5790ad5e71f651f85db76f612e39d2270b6510c3
parent6abee2608563599f783bf1305a8322ee7b447815
block: consolidate blocksize properties consistency checks

Several block device properties related to blocksize configuration must
be in certain relationship WRT each other: physical block must be no
smaller than logical block; min_io_size, opt_io_size, and
discard_granularity must be a multiple of a logical block.

To ensure these requirements are met, add corresponding consistency
checks to blkconf_blocksizes, adjusting its signature to communicate
possible error to the caller.  Also remove the now redundant consistency
checks from the specific devices.

Signed-off-by: Roman Kagan <rvkagan@yandex-team.ru>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Paul Durrant <paul@xen.org>
Message-Id: <20200528225516.1676602-3-rvkagan@yandex-team.ru>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/block/block.c
hw/block/fdc.c
hw/block/nvme.c
hw/block/swim.c
hw/block/virtio-blk.c
hw/block/xen-block.c
hw/ide/qdev.c
hw/scsi/scsi-disk.c
hw/usb/dev-storage.c
include/hw/block/block.h
tests/qemu-iotests/172.out