Re: [PATCH 06/11] file-posix: try BLKSECTGET on block devices too, do not round to power of 2

2021-06-25 Thread Max Reitz
On 24.06.21 20:04, Paolo Bonzini wrote: bs->sg is only true for character devices, but block devices can also be used with scsi-block and scsi-generic. Unfortunately BLKSECTGET returns bytes in an int for /dev/sgN devices, and sectors in a short for block devices, so account for that in the

[PATCH 06/11] file-posix: try BLKSECTGET on block devices too, do not round to power of 2

2021-06-24 Thread Paolo Bonzini
bs->sg is only true for character devices, but block devices can also be used with scsi-block and scsi-generic. Unfortunately BLKSECTGET returns bytes in an int for /dev/sgN devices, and sectors in a short for block devices, so account for that in the code. The maximum transfer also need not be