Skip to content

virtio-block: switch to blk_get_max_hw_transfer

Or Ozeri qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1virtio-block: switch to blk_get_max_hw_transferhw/block/virtio-blk.c+1 -13 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH v1 0/1] virtio-block: switch to blk_get_max_hw_transfer

Since moving to qemu 6.1.0 we've been seeing disk failures inside a qemu guest VM. This happened when using if=virtio on a host /dev/nbdX device.
Binary searching on qemu commit history, I found these errors start on this commit:

Commit 18473467
file-posix: try BLKSECTGET on block devices too, do not round to power of 2

The above commit switched posix block device limits (including host /dev/nbdX devices) to query limits from /sys/dev/block/..., instead of using predefined limits.

The scsi-generic driver was changed to use the queried limits, whereas the virtio-blk driver was only the queried max_iov, but still using the predefined max_transfer, which is unlimited in qemu.

For NBD devices, max_iov is unlimited by the kernel nbd driver.
As as consequence, the virtio-blk merged requests over the limit of our host /dev/nbdX device, which apparently caused the guest disk errors.

The solution that worked for me was to change the virtio-blk driver to use the max_transfer limit queried from the posix host device (given by blk_get_max_hw_transfer).

Or Ozeri (1):
virtio-block: switch to blk_get_max_hw_transfer

 hw/block/virtio-blk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.25.1