]> git.proxmox.com Git - mirror_qemu.git/commit - hw/block/virtio-blk.c
virtio-blk: store opt_io_size with correct size
authorRoman Kagan <rvkagan@yandex-team.ru>
Thu, 28 May 2020 22:55:09 +0000 (01:55 +0300)
committerKevin Wolf <kwolf@redhat.com>
Wed, 17 Jun 2020 12:53:40 +0000 (14:53 +0200)
commit6abee2608563599f783bf1305a8322ee7b447815
tree49edca75aba77a08ca5f11757d9e7fa77f4f9d9e
parentd54f36ea8c26af32584511533f8884ac7a50bf4a
virtio-blk: store opt_io_size with correct size

The width of opt_io_size in virtio_blk_config is 32bit.  However, it's
written with virtio_stw_p; this may result in value truncation, and on
big-endian systems with legacy virtio in completely bogus readings in
the guest.

Use the appropriate accessor to store it.

Signed-off-by: Roman Kagan <rvkagan@yandex-team.ru>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20200528225516.1676602-2-rvkagan@yandex-team.ru>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/block/virtio-blk.c