refresh_limits is not doing anything for block devices, and is retrieving the maximum number of s/g list entries incorrectly for character devices.
Patches 2-3 fix these problems, while patch 1 is a small improvement to avoid making the BlockLimits unnecessarily restrictive when SG_IO is not in use. Paolo Paolo Bonzini (3): scsi-generic: pass max_segments via max_iov field in BlockLimits file-posix: try BLKSECTGET on block devices too, do not round to power of 2 file-posix: fix max_iov for /dev/sg devices block/file-posix.c | 37 +++++++++++++++++++++++-------------- hw/scsi/scsi-generic.c | 6 ++++-- 2 files changed, 27 insertions(+), 16 deletions(-) -- 2.30.1